login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

a(1) = 1; a(n) = (sum of previous terms)^n mod n.
0

%I #5 Apr 04 2013 18:17:44

%S 1,1,2,0,4,4,5,1,0,4,0,4,0,4,0,0,13,1,6,0,8,20,9,9,1,23,0,8,12,10,26,

%T 0,11,17,29,1,12,20,8,16,3,1,36,0,0,18,19,1,18,26,13,9,10,0,34,32,30,

%U 34,43,1,8,36,8,0,50,60,43,21,25,1,18,0,12,70,25,45,30,40,4,16,80,72,37,1

%N a(1) = 1; a(n) = (sum of previous terms)^n mod n.

%e 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.

%p 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;

%t Module[{aa={1},n=1},Do[n=n+1;AppendTo[aa,PowerMod[Total[aa],n,n]],{90}];aa] (* _Harvey P. Dale_, Apr 04 2013 *)

%K nonn

%O 1,3

%A Chuck Seggelin (seqfan(AT)plastereddragon.com), Jun 03 2004