login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A119688 a(n) = n!! mod (n+1). 3
1, 2, 3, 3, 3, 6, 1, 6, 5, 1, 3, 8, 7, 0, 1, 13, 9, 1, 15, 0, 11, 1, 9, 0, 13, 0, 7, 17, 15, 1, 1, 0, 17, 0, 27, 6, 19, 0, 25, 9, 21, 1, 11, 0, 23, 46, 33, 0, 25, 0, 39, 30, 27, 0, 49, 0, 29, 58, 15, 50, 31, 0, 1, 0, 33, 1, 51, 0, 35, 1, 9, 27, 37, 0, 19, 0, 39, 78, 65, 0, 41, 82, 63, 0 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
The double factorial used here is A006882, a(n) = n*a(n-2). Bisections of A006882 are A000165 and A001147.
LINKS
Eric Weisstein's World of Mathematics, Double Factorial
EXAMPLE
5!! = 5*3*1 = 15, a(5) = 15 mod (5+1) = 3.
6!! = 6*4*2 = 48, a(6) = 48 mod (6+1) = 6.
MAPLE
P:= proc(n) local i, j, k, s; for k from 1 by 1 to n do i:=k; j:=k-2; while j >0 do i:=i*j; j:=j-2; od: s:=i mod (k+1); print(s); od: end: P(100);
## another version:
a:= proc(n) local t, m;
if irem (n, 2)=1 or n<14 or isprime(n+1)
then t:= 1;
for m from n by -2 while m>1 do
t:= (t*m) mod (n+1)
od; t
else 0 fi
end:
seq(a(n), n=1..100); # Alois P. Heinz, Feb 15 2011
MATHEMATICA
Table[Mod[n!!, n+1], {n, 100}] (* Zak Seidov, Feb 15 2011 *)
PROG
(Magma) DoubleFactorial:=func< n | &*[n..2 by -2] >; [ DoubleFactorial(n) mod (n+1): n in [1..100] ]; // Klaus Brockhaus, Feb 15 2011
(PARI) a(n) = prod(i=0, (n-1)\2, n - 2*i) % (n+1); \\ after PARI for A006882; Michel Marcus, Aug 22 2016
CROSSREFS
Sequence in context: A264870 A346048 A131048 * A126868 A134187 A078644
KEYWORD
easy,nonn
AUTHOR
EXTENSIONS
a(63) corrected, a(64) inserted by Klaus Brockhaus, Feb 15 2011
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 11 09:42 EDT 2024. Contains 372408 sequences. (Running on oeis4.)