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.
%I A119688 #22 Feb 16 2025 08:33:01 %S A119688 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, %T A119688 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, %U A119688 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 %N A119688 a(n) = n!! mod (n+1). %C A119688 The double factorial used here is A006882, a(n) = n*a(n-2). Bisections of A006882 are A000165 and A001147. %H A119688 Alois P. Heinz, <a href="/A119688/b119688.txt">Table of n, a(n) for n = 1..10000</a> %H A119688 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/DoubleFactorial.html">Double Factorial</a> %e A119688 5!! = 5*3*1 = 15, a(5) = 15 mod (5+1) = 3. %e A119688 6!! = 6*4*2 = 48, a(6) = 48 mod (6+1) = 6. %p A119688 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); %p A119688 ## another version: %p A119688 a:= proc(n) local t, m; %p A119688 if irem (n, 2)=1 or n<14 or isprime(n+1) %p A119688 then t:= 1; %p A119688 for m from n by -2 while m>1 do %p A119688 t:= (t*m) mod (n+1) %p A119688 od; t %p A119688 else 0 fi %p A119688 end: %p A119688 seq(a(n), n=1..100); # _Alois P. Heinz_, Feb 15 2011 %t A119688 Table[Mod[n!!,n+1],{n,100}] (* _Zak Seidov_, Feb 15 2011 *) %o A119688 (Magma) DoubleFactorial:=func< n | &*[n..2 by -2] >; [ DoubleFactorial(n) mod (n+1): n in [1..100] ]; // _Klaus Brockhaus_, Feb 15 2011 %o A119688 (PARI) a(n) = prod(i=0, (n-1)\2, n - 2*i) % (n+1); \\ after PARI for A006882; _Michel Marcus_, Aug 22 2016 %Y A119688 Cf. A006882, A000165, A001147, A061006. %K A119688 easy,nonn %O A119688 1,2 %A A119688 _Paolo P. Lava_ and _Giorgio Balzarotti_, Jun 09 2006 %E A119688 a(63) corrected, a(64) inserted by _Klaus Brockhaus_, Feb 15 2011