A220024 The period with which the powers of n repeat mod 10000.
1, 1, 500, 500, 250, 4, 125, 100, 500, 250, 1, 500, 500, 500, 250, 2, 125, 500, 100, 500, 1, 500, 500, 500, 50, 2, 25, 500, 500, 500, 1, 250, 100, 500, 250, 4, 125, 500, 500, 250, 1, 250, 500, 100, 250, 4, 125, 500, 500, 50, 1, 100, 500, 500, 250, 2, 125, 20
Offset: 0
Examples
a(2) = 500 since 2^i mod 10000 = 2^(i + 500) mod 10000, for all i >= 4. a(3) = 500 since 3^i mod 10000 = 3^(i + 500) mod 10000, for all i >= 0. But a(7) = 100 since 7^i mod 10000 = 7^(i + 100) mod 10000, 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, 10000], {e, 2, 10000}]; Union[Differences[Position[s, s[[3]]]]], {n, 0, 40}]] (* Vincenzo Librandi, Jan 26 2013 *) Table[Length[FindTransientRepeat[PowerMod[n,Range[3000],10000],3] [[2]]],{n,0,60}] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Nov 08 2016 *)
-
PARI
k=10000; for(n=0, 100, x=(n^4)%k; y=(n^5)%k; z=1; while(x!=y, x=(x*n)%k; y=(y*n*n)%k; z++); print1(z", "))
Comments