powered by
An inefficient, brute-force algorithm to assess whether or not an integer is prime.
prime(n)
The integer.
The function returns a logical object that is TRUE if the integer is prime.
The function assumes that n is a positive integer.
n
Jones, O.D., R. Maillardet, and A.P. Robinson. 2009. An Introduction to Scientific Programming and Simulation, Using R. Chapman And Hall/CRC.
primesieve
# NOT RUN { prime(10) prime(7) # }
Run the code above in your browser using DataLab