chickadee » math » random-prime

random-prime nprocedure
n
integer

Returns a random prime smaller than n, which must be greater than 2.

The function random-prime picks random numbers below n until a prime is found.

> (random-prime 10)
3
> (random-prime 10)
2
> (random-prime 10)
5