%I M2759 #63 Nov 25 2022 10:41:22
%S 1,1,3,8,31,147,853,5824,45741,405845,4012711,43733976,520795003,
%T 6726601063,93651619881,1398047697152,22275111534553,377278848390249,
%U 6768744159489931,128228860181918440,2557808459478878871,53585748788874537851,1176328664895760953853
%N a(n) = n*a(n-1) - a(n-2) + 1 + (-1)^n.
%C Row sums of A086764. - _Philippe Deléham_, Apr 27 2004
%C a(n+2m) == a(n) (mod m) for all n and m. - _Robert Israel_, Dec 06 2016
%D N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
%H T. D. Noe, <a href="/A003470/b003470.txt">Table of n, a(n) for n = 0..100</a>
%H John Riordan and N. J. A. Sloane, <a href="/A003471/a003471_1.pdf">Correspondence, 1974</a>
%F Diagonal sums of reverse of permutation triangle A008279. a(n) = Sum_{k=0..floor(n/2)} (n-k)!/k!. - _Paul Barry_, May 12 2004
%F a(n) = Sum_{k=0..floor(n/2)} C(n-k,k)*(n-2k)!. - _Paul Barry_ Dec 15 2010
%F G.f.: 1/(1-x^2-x/(1-x/(1-x^2-2x/(1-2x/(1-x^2-3x/(1-3x/(1-x^2-4x/(1-4x/(1-.... (continued fraction);
%F G.f.: 1/(1-x-x^2-x^2/(1-3x-x^2-4x^2/(1-5x-x^2-9x^2/(1-7x-x^2-16x^2/(1-... (continued fraction). - _Paul Barry_, Dec 15 2010
%F G.f.: hypergeom([1,1],[],x/(1-x^2))/(1-x^2). - _Mark van Hoeij_, Nov 08 2011
%F G.f.: 1/Q(0), where Q(k)= 1 - x^2 - x*(k+1)/(1-x*(k+1)/Q(k+1)); (continued fraction). - _Sergei N. Gladkovskii_, Apr 20 2013
%F From _Robert Israel_, Dec 06 2016: (Start)
%F a(2m) = hypergeom([1,-m,m+1],[],-1).
%F a(2m+1) = hypergeom([1,-m,m+2],[],-1)*(m+1).
%F a(2m-1) + a(2m+1) = (2m+1) a(2m). (End)
%F 0 = a(n)*(-a(n+2) - a(n+3)) + a(n+1)*(-2 + a(n+1) - 2*a(n+3) + a(n+4)) + a(n+2)*(-2*a(n+3) + a(n+4)) + a(n+3)*(+2 - a(n+3)) if n >= 0. - _Michael Somos_, Dec 06 2016
%F 0 = a(n)*(-a(n+2) + a(n+4)) + a(n+1)*(+a(n+1) - a(n+2) - a(n+3) + 3*a(n+4) - a(n+5)) + a(n+2)*(-a(n+3) + a(n+4)) + a(n+3)*(-a(n+4) + a(n+5)) + a(n+4)*(-a(n+4)) if n >= 0. - _Michael Somos_, Dec 06 2016
%F a(n) = Sum_{k=0..n} (-1)^k*hypergeom([k+1, k-n], [], -1). - _Peter Luschny_, Oct 05 2017
%F D-finite with recurrence: a(n) -n*a(n-1) +(n-2)*a(n-3) -a(n-4)=0. - _R. J. Mathar_, Apr 29 2020
%F a(n) ~ n! * (1 + 1/n + 1/(2*n^2) + 2/(3*n^3) + 25/(24*n^4) + 77/(40*n^5) + 2971/(720*n^6) + 6287/(630*n^7) + 1074809/(40320*n^8) + 28160749/(362880*n^9) + ...). - _Vaclav Kotesovec_, Nov 25 2022
%e G.f. = 1 + x + 3*x^2 + 8*x^3 + 31*x^4 + 147*x^5 + 853*x^6 + 5824*x^7 + ...
%p f:= gfun:-rectoproc({a(n) -(n-1)*a(n-1)-(n-2)*a(n-2)+a(n-3)-2=0,a(0)=1,a(1)=1,a(2)=3},a(n),remember):
%p map(f, [$0..30]); # _Robert Israel_, Dec 06 2016
%t t = {1, 1}; Do[AppendTo[t, n*t[[-1]] - t[[-2]] + 1 + (-1)^n], {n, 2, 20}] (* _T. D. Noe_, Oct 07 2013 *)
%t T[n_, k_] := HypergeometricPFQ[{k+1, k-n},{},-1];
%t Table[Sum[(-1)^k T[n,k], {k,0,n}], {n,0,22}] (* _Peter Luschny_, Oct 05 2017 *)
%Y Cf. A008279, A072374, A086764, A143409.
%K nonn,easy
%O 0,3
%A _N. J. A. Sloane_ and _John Riordan_
%E More terms from Gabriel Cunningham (gcasey(AT)mit.edu), Oct 25 2004