login
A072970
Least k > 0 such that the last digit of k^n is the same as the last digit of n*k.
0
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, 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, 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
OFFSET
1,2
FORMULA
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
MATHEMATICA
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 *)
PROG
(PARI) a(n)=if(n<0, 0, k=1; while(abs(k^n%10-(n*k)%10)>0, s++); s)
CROSSREFS
Sequence in context: A235052 A102066 A279404 * A276320 A011036 A086267
KEYWORD
base,easy,nonn
AUTHOR
Benoit Cloitre, Aug 13 2002
STATUS
approved