A220023 The period with which the powers of n repeat mod 1000.
1, 1, 100, 100, 50, 2, 25, 20, 100, 50, 1, 50, 100, 100, 50, 2, 25, 100, 20, 50, 1, 50, 100, 100, 10, 1, 5, 100, 100, 50, 1, 50, 20, 100, 50, 2, 25, 100, 100, 50, 1, 25, 100, 20, 50, 2, 25, 100, 100, 10, 1, 10, 100, 100, 50, 2, 25, 4, 100, 50, 1, 50, 100, 100
Offset: 0
Examples
a(2) = 100 since 2^i mod 1000 = 2^(i+100) mod 1000, for all i >= 3. a(3) = 100 since 3^i mod 1000 = 3^(i+100) mod 1000, for all i >= 0. But a(7) = 20 since 7^i mod 1000 = 7^(i+20) mod 1000, 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, 1000], {e, 2, 1000}]; Union[Differences[Position[s, s[[2]]]]], {n, 0, 40}]] (* Vincenzo Librandi, Jan 26 2013 *)
-
PARI
k=1000; for(n=0, 100, x=(n^3)%k; y=(n^4)%k; z=1; while(x!=y, x=(x*n)%k; y=(y*n*n)%k; z++); print1(z", "))
Comments