OFFSET
1,3
EXAMPLE
a(4) = 0 because the previous terms 1, 1, 2 sum to 4 and 4^4 mod 4 is 0. a(5) = 4 because the previous terms 1, 1, 2, 0 sum to 4 and 4^5 mod 5 is 4.
MAPLE
L := [1]; s := 1; p := 2; while (nops(L) < 90) do; if 1>0 then; t := (s^p) mod p; L := [op(L), t]; s := s+t; p := p+1; fi; od; L;
MATHEMATICA
Module[{aa={1}, n=1}, Do[n=n+1; AppendTo[aa, PowerMod[Total[aa], n, n]], {90}]; aa] (* Harvey P. Dale, Apr 04 2013 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Chuck Seggelin (seqfan(AT)plastereddragon.com), Jun 03 2004
STATUS
approved