prime {spuRs} | R Documentation |
An inefficient, brute-force algorithm to assess whether or not an integer is prime.
prime(n)
n |
The integer. |
The function assumes that n
is a positive integer.
The function returns a logical object that is TRUE if the integer is prime.
Jones, O.D., R. Maillardet, and A.P. Robinson. 2009. An Introduction to Scientific Programming and Simulation, Using R. Chapman And Hall/CRC.
prime(10)
prime(7)