Mersenne Primes
Mersenne Primes take the form . Often we just loop through all possible Mersenne primes and check if either or are that.
This is very easy to do in Sage:
from sage.combinat.sloane_functions import A000668
mersenne = A000668()
Then we can grab the th Mersenne prime using mersenne(n)
.
Last updated
Was this helpful?