OFFSET
1,1
FORMULA
a(n)=n+b(n) where b(n) is a periodic sequence with period (10, 16, 14, 2, 10, 2, 6, 4, 10, 10, 10, 2, 14, 2, 10, 8, 6, 4, 10, 10, 10) of length 21
MATHEMATICA
lkld[n_]:=Module[{ldn=Mod[n^n, 10], k=n+2}, While[Mod[k^k, 10]!=ldn, k=k+2]; k]; Array[lkld, 70] (* Harvey P. Dale, Feb 15 2015 *)
PROG
(PARI) a(n)=if(n<0, 0, s=n+1; while(abs(s^s%10-n^n%10)>0, s++); s)
CROSSREFS
KEYWORD
base,easy,nonn
AUTHOR
Benoit Cloitre, Aug 13 2002
STATUS
approved