prime: Function to assess whether or not an integer is prime.

Description Usage Arguments Details Value References See Also Examples

View source: R/prime.R

Description

An inefficient, brute-force algorithm to assess whether or not an integer is prime.

Usage

1
prime(n)

Arguments

n

The integer.

Details

The function assumes that n is a positive integer.

Value

The function returns a logical object that is TRUE if the integer is prime.

References

Jones, O.D., R. Maillardet, and A.P. Robinson. 2009. An Introduction to Scientific Programming and Simulation, Using R. Chapman And Hall/CRC.

See Also

primesieve

Examples

1
2
prime(10)
prime(7)

spuRs documentation built on May 2, 2019, 12:44 p.m.

Related to prime in spuRs...