You are viewing a single comment's thread. Return to all comments →
Sovled in Java 8 using BigInteger.modPow(BigInteger exponent, BigInteger m). Optimize the input, multiply/add/mod, use primitive long.
BigInteger.modPow(BigInteger exponent, BigInteger m)
long
Seems like cookies are disabled on this browser, please enable them to open this website
Project Euler #97: Large non-Mersenne prime
You are viewing a single comment's thread. Return to all comments →
Sovled in Java 8 using
BigInteger.modPow(BigInteger exponent, BigInteger m)
. Optimize the input, multiply/add/mod, use primitivelong
.