%I #60 Jul 30 2024 11:08:17
%S 0,1,5,31,222,1807,16485,166657,1849712,22363201,292571325,4118361751,
%T 62067997590,997206323191,17014575491837,307259565176257,
%U 5854946313840720,117406185841990657,2471384848995644517,54487872863746170031,1255692460715157555230
%N a(n) = (n+3)*a(n-1) + a(n-2), with a(0)=0, a(1)=1.
%H G. C. Greubel, <a href="/A058309/b058309.txt">Table of n, a(n) for n = 0..445</a>
%H S. Janson, <a href="https://doi.org/10.46298/dmtcs.520">A divergent generating function that can be summed and analysed analytically</a>, Discrete Mathematics and Theoretical Computer Science; 2010, Vol. 12, No. 2, 1-22.
%H Russell Walsmith, <a href="/A058309/a058309.pdf">DCL-Chemy II: Reflections and Other Symmetries</a>
%F a(n) = Sum_{k = 0..floor((n-1)/2)} (n-2*k-1)!*binomial(n-k-1,k)* binomial(n-k+3,k+4). Cf. A058798. - _Peter Bala_, Aug 01 2013
%F a(n) = (I(n+4,-2)*(5*K_5-K_6)+K(n+4,2)*(5*I_5+I_6))/(I_6*K_5+I_5* K_6), where I_n and K_n are the Bessel functions of the first respectively the second kind, all evaluated at x=2. - _Peter Luschny_, Sep 11 2014
%F a(n) = (n+3)!*hypergeometric([1/2-n/2, 1-n/2], [5, -n-3, 1-n], 4)/24 for n >= 2. - _Peter Luschny_, Sep 12 2014
%F 0 = a(n)*(+a(n+2)) + a(n+1)*(-a(n+1) - a(n+2) + a(n+3)) + a(n+2)*(-a(n+2)) for all n in Z. - _Michael Somos_, Sep 13 2014
%F a(-8-n) = a(n) for all n in Z. - _Michael Somos_, Sep 13 2014
%F a(n) ~ c * n! * n^3, where c = 7*BesselI(0,2) - 10*BesselI(1,2) = 0.050728569979180238237886835684070993456106124542846907172998415564687... - _Vaclav Kotesovec_, May 05 2024
%e G.f. = x + 5*x^2 + 31*x^3 + 222*x^4 + 1807*x^5 + 16485*x^6 + 166657*x^7 + ...
%p bi:=n->BesselI(4+n,-2); bk:=n->BesselK(4+n,2); i:=n->BesselI(n,2);
%p k:=n->BesselK(n,2); a := n ->(bi(n)*(5*k(5)-k(6))+bk(n)*(5*i(5) +i(6)))/(i(6)*k(5)+i(5)*k(6)); seq(round(evalf(a(n),99)),n=0..20); # _Peter Luschny_, Sep 11 2014
%t a[0] = 0; a[1] = 1; a[n_] := a[n - 2] + (n + 3)*a[n - 1]; Table[a[n], {n, 0, 20}] (* _Wesley Ivan Hurt_, Sep 12 2014 *)
%t a[ n_] := With[{m = n + 4}, 2 (BesselK[m, 2] BesselI[4, 2] - (-1)^m BesselI[m, 2] BesselK[4, 2]) // FullSimplify]; (* _Michael Somos_, Dec 09 2014 *)
%t a[ n_] := With[{m = Abs[n + 4]}, If[ m < 5, {-10, 7, -3, 1, 0}[[m + 1]], (m - 1)! HypergeometricPFQ[ {5/2 - m/2, 3 - m/2}, {5, 1 - m, 5 - m}, 4] / 24]]; (* _Michael Somos_, Dec 09 2014 *)
%t nxt[{n_,a_,b_}]:={n+1,b,b(n+4)+a}; NestList[nxt,{1,0,1},20][[;;,2]] (* _Harvey P. Dale_, Jul 30 2024 *)
%o (PARI) a(n)=round((besseli(n+4,-2)*(5*besselk(5,2)-besselk(6,2)) + besselk(n+4,2)*(5*besseli(5,2) + besseli(6,2))) / (besseli(6,2)*besselk(5,2) + besseli(5,2)*besselk(6,2))) \\ _Charles R Greathouse IV_, Sep 11 2014
%o (PARI) m=30; v=concat([0,1], vector(m-2)); for(n=3, m, v[n]=(n+2)*v[n-1] +v[n-2]); v \\ _G. C. Greubel_, Nov 24 2018
%o (Sage)
%o def A058309(n):
%o if n < 2: return n
%o return factorial(n+3)*hypergeometric([1/2-n/2, 1-n/2], [5, -n-3, 1-n], 4)/24
%o [round(A058309(n).n(100)) for n in (0..20)] # _Peter Luschny_, Sep 12 2014
%o (Magma) I:=[1,5]; [0] cat [n le 2 select I[n] else (n+3)*Self(n-1) +Self(n-2): n in [1..30]]; // _G. C. Greubel_, Nov 24 2018
%o (Sage)
%o @cached_function
%o def A058309(n):
%o if (n==0): return 0
%o elif (n==1): return 1
%o else: return (n+3)*A058309(n-1) + A058309(n-2)
%o [A058309(n) for n in range(30)] # _G. C. Greubel_, Nov 24 2018
%Y A column of A058294. Cf. A058798.
%K nonn
%O 0,3
%A _N. J. A. Sloane_, Dec 09 2000