login
The period with which the powers of n repeat mod 100.
6

%I #36 Apr 20 2023 14:15:53

%S 1,1,20,20,10,1,5,4,20,10,1,10,20,20,10,2,5,20,4,10,1,5,20,20,2,1,1,

%T 20,20,10,1,10,4,20,10,2,5,20,20,10,1,5,20,4,10,1,5,20,20,2,1,2,20,20,

%U 10,2,5,4,20,10,1,5,20,20,10,1,5,20,4,10,1,10,20,20,2,2,1

%N The period with which the powers of n repeat mod 100.

%C a(n) will always be a divisor of Phi(100) = 40.

%C This sequence is periodic with a period of 100 because n^i mod 100 = (n + 100)^i mod 100.

%C For the odd numbers n ending in {1, 3, 7, 9} which are coprime to 10, we can expect the powers of n mod 100 to loop back to 1, with the value of n^a(n) mod 100 = 1, but for the other numbers n that are not coprime to 10, they do not loop back to 1.

%C For the even numbers n ending in {2, 4, 6, 8}, the value of n^a(n) mod 100 will be equal to 76.

%C For the numbers n that are congruent to 5 (mod 20), the value of n^i mod 100 will be equal to 25, for all i >= 2.

%C For the numbers n that are congruent to 15 (mod 20), the value of n^a(n) mod 100 will be equal to 25, with n^i mod 100 = 25 for the even values of i and n^i mod 100 = 75 for the odd values of i, for all i >= 2.

%C For the numbers n ending in 0, i.e., that are congruent to 0 (mod 10), the value of n^i mod 100 will be equal to 0, for all i >= 2.

%H T. D. Noe, <a href="/A220022/b220022.txt">Table of n, a(n) for n = 0..1000</a>

%H <a href="/index/Rec#order_100">Index entries for linear recurrences with constant coefficients</a>, signature (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1).

%e a(2) = 20 since 2^i mod 100, for i = 2..22 = {04, 08, 16, 32, 64, 28, 56, 12, 24, 48, 96, 92, 84, 68, 36, 72, 44, 88, 76, 52, 04}.

%e a(3) = 20 since 3^i mod 100, for i = 0..20 = {01, 03, 09, 27, 81, 43, 29, 87, 61, 83, 49, 47, 41, 23, 69, 07, 21, 63, 89, 67, 01}.

%e But a(7) = 4 since 7^i mod 100, for i = 0..4 = {01, 07, 49, 43, 01}.

%t Flatten[Table[s = Table[PowerMod[n, e, 100], {e, 2, 100}]; Union[Differences[Position[s, s[[1]]]]], {n, 0, 100}]] (* _T. D. Noe_, Dec 14 2012 *)

%o (PARI) for(n=0, 100, x=(n*n)%100; y=(n*n*n)%100; z=1; while(x!=y, x=(x*n)%100; y=(y*n*n)%100; z++); print1(z", "))

%Y Cf. A173635 (period with which the powers of n repeat mod 10).

%K nonn,base,easy

%O 0,3

%A _V. Raman_, Dec 13 2012