Large Non-Mersenne Prime¶
We'll use modular exponentiation - see problem 48 for further explanation.
In [1]:
modulus = 10^10
(28433 * pow(2, 7830457, modulus) + 1) % modulus
Out[1]:
8739992577
Copyright (C) 2025 filifa¶
This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International license and the BSD Zero Clause license.