You are viewing a single comment's thread. Return to all comments →
This is a pretty fun problem.
We can see that 111...N times mod m = (999.. N times mod 9m) / 9 by mod distributive law
999.. N times mod 9m can be calculated efficiently with binary exponentiation, it is 10^N - 1, and the 10^N can be calculated in log N time.
Now when do I get a gf.....
Seems like cookies are disabled on this browser, please enable them to open this website
Akhil and GF
You are viewing a single comment's thread. Return to all comments →
This is a pretty fun problem.
We can see that 111...N times mod m = (999.. N times mod 9m) / 9 by mod distributive law
999.. N times mod 9m can be calculated efficiently with binary exponentiation, it is 10^N - 1, and the 10^N can be calculated in log N time.
Now when do I get a gf.....