Prime and number theoretic utilities. Returns a pair whose car is the power of 2 in the factorization of n, and whose cdr is the product of all remaining primes.
nis definitely prime. May take an impossibly long time for large values.
nto be composite by finding an exception to the Miller Rabin lemma.
nhas a very high probability (enough that you can assume a false positive will never occur in your lifetime) of being prime.
nis prime. Uses
n, falling back on
probable-prime?for large values.
n, or #f if there are no such primes.
n. If the optional
limitis given and not false, returns
#fif no such primes exist below
nas a monotonically increasing list of primes.
nthat are relatively prime to
nis a perfect number, i.e. the sum of its divisors other than itself equals itself.
lo, inclusive, and
random-primewhich ensures the result is distinct from
nrelatively prime to