A094405 a(1) = 1; a(n) = (sum of previous terms) mod n.
1, 1, 2, 0, 4, 2, 3, 5, 0, 8, 4, 6, 10, 4, 5, 7, 11, 1, 17, 11, 18, 10, 15, 1, 21, 11, 16, 26, 17, 27, 16, 24, 7, 5, 1, 29, 13, 17, 25, 1, 33, 15, 20, 30, 5, 45, 33, 7, 2, 42, 22, 32, 52, 38, 8, 2, 47, 23, 32, 50, 25, 35, 55, 31, 46, 10, 3, 57, 29, 41, 65, 41, 64, 36, 53, 11, 2, 62, 26
Offset: 1
Keywords
Examples
a(4) = 0 because the previous terms 1, 1, 2 sum to 4 and 4 mod 4 is 0. a(5) = 4 because the previous terms 1, 1, 2, 0 sum to 4 and 4 mod 5 is 4.
Programs
-
Maple
L := [1]; s := 1; p := 2; while (nops(L) < 90) do; if 1>0 then; t := s mod p; L := [op(L),t]; s := s+t; p := p+1; fi; od; L;
Comments