I made a similar algorithm to yours and got the same error. The problem was that when I modulo 101^exp, I got the result of 1, which was used as the exponent for the next number.
This problem happens whenever base^exp ends with .....0x. So modulo cuts the number to the ending digit x, which makes the next steps for that case into 2^(2^1)=2^2-1. Whereas 2^(2^101)=2^(long number which ends with....52) = long number which ends with 6.
Try changing the algorithm to do something slightly different for these cases.
There might, if I knew the language I might fix it.
I made a similar algorithm to yours and got the same error. The problem was that when I modulo 101^exp, I got the result of 1, which was used as the exponent for the next number.
This problem happens whenever base^exp ends with .....0x. So modulo cuts the number to the ending digit x, which makes the next steps for that case into 2^(2^1)=2^2-1. Whereas 2^(2^101)=2^(long number which ends with....52) = long number which ends with 6.
Try changing the algorithm to do something slightly different for these cases.
This comment is hidden because it contains spoiler information about the solution
4⁰ == 1
.Totally agree. They should change it.
agreed!