A220026 The period with which the powers of n repeat mod 1000000.
1, 1, 12500, 50000, 6250, 16, 3125, 5000, 12500, 25000, 1, 50000, 12500, 50000, 6250, 4, 3125, 12500, 2500, 50000, 1, 50000, 12500, 25000, 1250, 8, 625, 50000, 12500, 50000, 1, 6250, 2500, 12500, 6250, 16, 3125, 50000, 12500, 25000, 1, 25000, 12500, 10000, 6250
Offset: 0
Examples
a(2) = 12500 since 2^i mod 1000000 = 2^(i + 12500) mod 1000000, for all i >= 6. a(3) = 50000 since 3^i mod 1000000 = 3^(i + 50000) mod 1000000, for all i >= 0. But a(7) = 5000 since 7^i mod 1000000 = 7^(i + 5000) mod 1000000, for all i >= 0.
Links
- Vincenzo Librandi, Table of n, a(n) for n = 0..1000
Crossrefs
Programs
-
Mathematica
Flatten[Table[s = Table[PowerMod[n, e, 1000000], {e, 2, 1000000}]; Union[Differences[Position[s, s[[5]]]]], {n, 0, 40}]] (* Vincenzo Librandi, Jan 26 2013 *)
-
PARI
k=1000000; for(n=0, 100, x=(n^6)%k; y=(n^7)%k; z=1; while(x!=y, x=(x*n)%k; y=(y*n*n)%k; z++); print1(z", "))
Comments