chickadee » math » prime?

prime? zprocedure
z
integer

Returns #t if z is a prime, #f otherwise.

Formally, an integer z is prime when the only positive divisors of z are 1 and (abs z).

The positive primes below 20 are:

> (filter prime? (iota 20 1))
(2 3 5 7 11 13 17 19)

The corresponding negative primes are:

> (filter prime? (iota 20 0 -1))
(-2 -3 -5 -7 -11 -13 -17 -19)

Wikipedia: Prime Number