cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A119688 a(n) = n!! mod (n+1).

Original entry on oeis.org

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
Offset: 1

Views

Author

Keywords

Comments

The double factorial used here is A006882, a(n) = n*a(n-2). Bisections of A006882 are A000165 and A001147.

Examples

			5!! = 5*3*1 = 15, a(5) = 15 mod (5+1) = 3.
6!! = 6*4*2 = 48, a(6) = 48 mod (6+1) = 6.
		

Crossrefs

Programs

  • Magma
    DoubleFactorial:=func< n | &*[n..2 by -2] >; [ DoubleFactorial(n) mod (n+1): n in [1..100] ]; // Klaus Brockhaus, Feb 15 2011
    
  • 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 *)
  • PARI
    a(n) = prod(i=0, (n-1)\2, n - 2*i) % (n+1); \\ after PARI for A006882; Michel Marcus, Aug 22 2016

Extensions

a(63) corrected, a(64) inserted by Klaus Brockhaus, Feb 15 2011