OFFSET
0,3
COMMENTS
LINKS
Ray Chandler, Table of n, a(n) for n = 0..999
Index entries for linear recurrences with constant coefficients, signature (1, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 1, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 1, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 1, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 1, -1, 1).
MATHEMATICA
Table[Mod[Sum[PowerMod[i, i^i, 10], {i, 1, n}], 10], {n, 200}]
Mod[Accumulate[Table[PowerMod[i, i^i, 10], {i, 100}]], 10] (* T. D. Noe, Sep 30 2013 *)
PROG
(PARI) a(n)=lift(sum(k=1, n%100, Mod(k, 10)^k^k)) \\ Charles R Greathouse IV, Dec 27 2013
(Python)
from itertools import count, accumulate, islice
def A229784_gen(): # generator of terms
yield from accumulate((pow(k, k**k, 10) for k in count(1)), func=lambda x, y:(x+y)%10)
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
José María Grau Ribas, Sep 29 2013
EXTENSIONS
a(0)=0 prepended by Alois P. Heinz, Jun 17 2022
STATUS
approved