OFFSET
1,3
EXAMPLE
n=3 (n+1)!! = 4!! = 8; (8 mod 3) = 2.
n=4 (n+1)!! = 5!! = 15; (15 mod 4) = 3.
MAPLE
P:=proc(n) local i, j, k, w; for i from 1 by 1 to n do k:=i+1; w:=i-1; while w>0 do k:=k*w; w:=w-2; od; j:=(k mod i); print(j); od; end: P(100);
PROG
(PARI) df(n) = prod(i=0, (n-1)\2, n - 2*i );
a(n) = df(n+1) % n; \\ Michel Marcus, Aug 22 2016
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Paolo P. Lava and Giorgio Balzarotti, Mar 16 2007
STATUS
approved