This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A220024 #22 Jul 25 2017 02:29:56 %S A220024 1,1,500,500,250,4,125,100,500,250,1,500,500,500,250,2,125,500,100, %T A220024 500,1,500,500,500,50,2,25,500,500,500,1,250,100,500,250,4,125,500, %U A220024 500,250,1,250,500,100,250,4,125,500,500,50,1,100,500,500,250,2,125,20 %N A220024 The period with which the powers of n repeat mod 10000. %C A220024 a(n) will always be a divisor of Phi(10000) = 4000. %C A220024 This sequence is periodic with a period of 10000 because n^i mod 10000 = (n + 10000)^i mod 10000. %C A220024 For the odd numbers n ending in {1, 3, 7, 9} which are coprime to 10, we can expect the powers of n mod 10000 to loop back to 1, with the value of n^a(n) mod 10000 = 1, but for the other numbers n that are not coprime to 10, they do not loop back to 1. %C A220024 For the even numbers n ending in {2, 4, 6, 8}, n^a(n) mod 10000 = 9376. %C A220024 For the numbers n ending in 5, n^(4*i) mod 10000 = 625, for all i >= 1. %C A220024 For the numbers n ending in 0, n^i mod 10000 = 0, for all i >= 4. %H A220024 Vincenzo Librandi, <a href="/A220024/b220024.txt">Table of n, a(n) for n = 0..1000</a> %e A220024 a(2) = 500 since 2^i mod 10000 = 2^(i + 500) mod 10000, for all i >= 4. %e A220024 a(3) = 500 since 3^i mod 10000 = 3^(i + 500) mod 10000, for all i >= 0. %e A220024 But a(7) = 100 since 7^i mod 10000 = 7^(i + 100) mod 10000, for all i >= 0. %t A220024 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 *) %t A220024 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 *) %o A220024 (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", ")) %Y A220024 Cf. A173635 (period with which the powers of n repeat mod 10). %Y A220024 Cf. A220022 (period with which the powers of n repeat mod 100). %K A220024 nonn,base %O A220024 0,3 %A A220024 _V. Raman_, Dec 15 2012