OFFSET
1,3
FORMULA
For n>1: if neither n nor n+1 is prime, then a(n)=0. Otherwise, a(n)=n(n-1)/2 - 1 for odd n and a(n)=n(n-1)/2 for even n. - Ivan Neretin, May 29 2015
EXAMPLE
a(5) = (5-1)! mod (1+2+3+4+5) = 24 mod 15 = 9.
MAPLE
P:=proc(n) local i, k; for i from 1 by 1 to n do print((i-1)! mod sum('k', 'k'=0..i)); od; end: P(100);
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Paolo P. Lava, Jun 30 2006
STATUS
approved