smallPrimes is used to precompute primes under
smallPrimes is used to support more complex factorization and primality related modules, where taking care of small prime cases can greatly increase more costly functions.
In particular, the prime decomposition function acts as a prime certificate for an integer
#Express a prime congruent to 1 mod 4 as a sum of squares.
sumOfSquares(13)
>>> (3, 2)
#Returns primes less than N.
genPrimes(50)
>>> [ 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47]
#Return the prime decomposition.
primeDecomposition(360)
>>> Counter({2: 3, 3: 2, 5: 1})
#Return a certificate for a prime decomposition.
decompCertificate(37)
>>> True
#Return a sorted list of all divisors.
divisors(36)
>>> [1, 2, 3, 4, 6, 9, 12, 18, 36]
divisors(36, proper=True)
>>> [2, 3, 4, 6, 9, 12, 18]