OFFSET
0,3
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..790
FORMULA
a(0)=a(1)=1; a(2n) = A001147(2*n-2) odd terms, double factorial numbers; a(2n-1) = A002866(n) = 2^(n-1)*n!
0 = a(n)*(a(n+1) - a(n+3)) + a(n+1)*a(n+2) if n>=0. - Michael Somos, Jan 24 2014
a(n) = (n-1)-st term of column 1 of the array at A249159, for n >= 0. - Clark Kimberling, Oct 23 2014
EXAMPLE
G.f. = 1 + x + 3*x^2 + 4*x^3 + 15*x^4 + 24*x^5 + 105*x^6 + 192*x^7 + ...
MAPLE
a[0]:=1:a[1]:=1:for n from 2 to 50 do a[n]:=(a[n-2]*(n+1)^2) od: seq(sqrt(a[n]), n=0..26); # Zerinvary Lajos, Mar 04 2008
MATHEMATICA
f[n_]:= (n+1)*f[n-2]; f[0] = 1; f[1] = 1; Table[f[n], {n, 1, 30}]
a[ n_]:= If[ n < 0, 0, If[OddQ[n], 2^((n-1)/2) ((n+1)/2)!, (n+1)!!]]; (* Michael Somos, Jan 24 2014 *)
RecurrenceTable[{a[0]==a[1]==1, a[n]==(n+1)a[n-2]}, a, {n, 30}] (* Harvey P. Dale, Nov 05 2021 *)
PROG
(PARI) {a(n) = if( n<2, n>=0, (n+1) * a(n-2))}; /* Michael Somos, Jan 24 2014 */
(PARI) {a(n) = if( n<0, 0, if( n%2, 2^(n\2) * (n\2 + 1)!, (n+1)! / (2^(n\2) * (n\2)!)))}; /* Michael Somos, Jan 24 2014 */
(Magma) [n le 1 select 1 else (n+1)*Self(n-1): n in [0..30]]; // Vincenzo Librandi, Oct 26 2014
(Sage)
def a(n):
if n<2: return 1
else: return (n+1)*a(n-2)
[a(n) for n in (0..30)] # G. C. Greubel, Aug 24 2019
(GAP)
a:= function(n)
if n<2 then return 1;
else return (n+1)*a(n-2);
fi;
end;
List([0..30], n-> a(n) ); # G. C. Greubel, Aug 24 2019
CROSSREFS
KEYWORD
nonn
AUTHOR
Labos Elemer, Apr 01 2003
STATUS
approved