OFFSET
1,1
LINKS
Zhuorui He, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,-1).
FORMULA
a(n) = n + A072968(n) where A072968(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) of length 20. [corrected by Zhuorui He, Jun 13 2026]
a(n+20) = a(n) + 20. - Zhuorui He, Jun 13 2026
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
