

A071358


Least k>0 such that the last digit of (n+k)^n is the same as the last digit of n^n.


0



10, 6, 10, 2, 10, 8, 10, 4, 10, 10, 10, 2, 10, 2, 10, 2, 10, 4, 10, 10, 10, 6, 10, 2, 10, 8, 10, 4, 10, 10, 10, 2, 10, 2, 10, 2, 10, 4, 10, 10, 10, 6, 10, 2, 10, 8, 10, 4, 10, 10, 10, 2, 10, 2, 10, 2, 10, 4, 10, 10, 10, 6, 10, 2, 10, 8, 10, 4, 10, 10, 10, 2, 10, 2, 10, 2, 10, 4, 10, 10
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

1,1


LINKS

Table of n, a(n) for n=1..80.
Index entries for linear recurrences with constant coefficients, signature (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1).


FORMULA

a(n) is periodic with period (10, 6, 10, 2, 10, 8, 10, 4, 10, 10, 10, 2, 10, 2, 10, 2, 10, 4, 10, 10) of length 20


MATHEMATICA

LinearRecurrence[{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}, {10, 6, 10, 2, 10, 8, 10, 4, 10, 10, 10, 2, 10, 2, 10, 2, 10, 4, 10, 10}, 80] (* Ray Chandler, Aug 26 2015 *)


PROG

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


CROSSREFS

Sequence in context: A076366 A105155 A072930 * A167873 A033986 A049004
Adjacent sequences: A071355 A071356 A071357 * A071359 A071360 A071361


KEYWORD

easy,nonn,base


AUTHOR

Benoit Cloitre, Aug 13 2002


STATUS

approved



