The OEIS is supported by the many generous donors to the OEIS Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A072970 Least k > 0 such that the last digit of k^n is the same as the last digit of n*k. 0

%I #12 Sep 08 2012 09:50:31

%S 1,2,5,4,5,6,5,2,5,10,1,8,5,4,5,6,5,8,2,10,1,2,5,4,5,6,5,2,5,10,1,8,5,

%T 4,5,6,5,8,2,10,1,2,5,4,5,6,5,2,5,10,1,8,5,4,5,6,5,8,2,10,1,2,5,4,5,6,

%U 5,2,5,10,1,8,5,4,5,6,5,8,2,10,1,2,5,4,5,6,5,2,5,10,1,8,5,4,5,6,5,8,2

%N Least k > 0 such that the last digit of k^n is the same as the last digit of n*k.

%F a(n) is a periodic sequence with period (1, 2, 5, 4, 5, 6, 5, 2, 5, 10, 1, 8, 5, 4, 5, 6, 5, 8, 2, 10) of length 20

%F a(n)=(1/3800)*{1809*(n mod 20) - 1421*[(n + 1) mod 20] + 1239*[(n + 2) mod 20] - 471*[(n + 3) mod 20] + 289*[(n + 4) mod 20] - 91*[(n + 5) mod 20] - 91*[(n + 6) mod 20] + 289*[(n + 7) mod 20] + 669*[(n + 8) mod 20] - 1231*[(n + 9) mod 20] + 1809*[(n + 10) mod 20] - 851*[(n + 11) mod 20] - 471*[(n + 12) mod 20] + 669*[(n + 13) mod 20] + 289*[(n + 14) mod 20] - 91*[(n + 15) mod 20] - 91*[(n + 16) mod 20] + 289*[(n + 17) mod 20] - 471*[(n + 18) mod 20] - 91*[(n + 19) mod 20]}, with n>=0 - _Paolo P. Lava_, Jun 11 2007

%t kld[n_]:=Module[{k=1},While[PowerMod[k,n,10]!=Mod[n*k,10],k++];k]; Array[kld,100] (* _Harvey P. Dale_, Sep 08 2012 *)

%o (PARI) a(n)=if(n<0,0,k=1; while(abs(k^n%10-(n*k)%10)>0,s++); s)

%K base,easy,nonn

%O 1,2

%A _Benoit Cloitre_, Aug 13 2002

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

Last modified September 23 23:38 EDT 2023. Contains 365554 sequences. (Running on oeis4.)