OFFSET
2,1
FORMULA
a(n) = A152667(n,1).
a(2n) = (n+1)(n!)^2;
a(2n+1) = n!(n+2)!
E.g.f.: 24*sqrt(4-x^2)*arcsin(x/2)/[(2-x)^3*(2+x)^2] - x(6-8x-3x^2+2x^3)/ [(2+x)(2-x)^2].
G.f.: G(0)/x^2 -1/x^2 -2/x, where G(k) = 1 + x*(k+2)/(1 - x*(k+1)/ (x*(k+1) + 1/G(k+1))); (continued fraction). - Sergei N. Gladkovskii, Jun 07 2013
D-finite with recurrence 4*a(n) -2*a(n-1) -(n+2)*(n-1)*a(n-2)=0. - R. J. Mathar, Jul 24 2022
Sum_{n>=2} 1/a(n) = BesselI(1, 2) + BesselI(2, 2) - 3/2 = A096789 + A229020 - 3/2. - Amiram Eldar, Jan 22 2023
EXAMPLE
a(4) = 12 because we have 2413, 2431, 4213, 4231, 1243, 1423 and their reverses.
MAPLE
ae := proc (n) options operator, arrow: factorial(n)^2*(n+1) end proc: ao := proc (n) options operator, arrow: factorial(n)*factorial(n+2) end proc: a := proc (n) if `mod`(n, 2) = 0 then ae((1/2)*n) else ao((1/2)*n-1/2) end if end proc; seq(a(n), n = 2 .. 23);
# second Maple program:
a:= n-> (h-> h!*(h+1+(n mod 2))!)(iquo(n, 2)):
seq(a(n), n=2..25); # Alois P. Heinz, Sep 24 2024
MATHEMATICA
a[n_] := If[OddQ[n], ((n - 1)/2)!*((n + 3)/2)!, (n/2 + 1) ((n/2)!)^2]; Array[a, 25, 2] (* Amiram Eldar, Jan 22 2023 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Emeric Deutsch, Dec 14 2008
STATUS
approved