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”).

c(n) mod b(n) where c(n) = (n-1)! and b(n) = Sum_{i=1..n} i.
1

%I #7 May 29 2015 06:31:33

%S 0,1,2,6,9,15,20,0,0,45,54,66,77,0,0,120,135,153,170,0,0,231,252,0,0,

%T 0,0,378,405,435,464,0,0,0,0,630,665,0,0,780,819,861,902,0,0,1035,

%U 1080,0,0,0,0,1326,1377,0,0,0,0,1653,1710,1770,1829,0,0,0,0,2145,2210,0,0,2415

%N c(n) mod b(n) where c(n) = (n-1)! and b(n) = Sum_{i=1..n} i.

%F 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

%e a(5) = (5-1)! mod (1+2+3+4+5) = 24 mod 15 = 9.

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

%Y Cf. A000217, A116536.

%Y Cf. A226718, A119690.

%K easy,nonn

%O 1,3

%A _Paolo P. Lava_, Jun 30 2006