%I #32 Dec 12 2018 14:24:08
%S -1,0,1,2,8,40,244,1736,14084,128176,1292788,14313272,172603124,
%T 2252192608,31620422980,475350915656,7618759828388,129697180826512,
%U 2337145267316500,44446207287450968,889595868295057364,18693361200724345024,411475140936880082020
%N a(0) = -1; for n > 0, number of indecomposable derangements, i.e., no fixed points, and not fixing [1..j] for any 1 <= j < n.
%C The derangement characterization would yield a(0) = 1, but -1 is the value given in Martin and Kearney's paper. - _Eric M. Schmidt_, Jul 10 2015
%H Eric M. Schmidt, <a href="/A259869/b259869.txt">Table of n, a(n) for n = 0..300</a>
%H Jesse Elliott, <a href="https://arxiv.org/abs/1809.06633">Asymptotic expansions of the prime counting function</a>, arXiv:1809.06633 [math.NT], 2018.
%H Richard J. Martin, and Michael J. Kearney, <a href="http://dx.doi.org/10.1007/s00493-014-3183-3">Integral representation of certain combinatorial recurrences</a>, Combinatorica: 35:3 (2015), 309-315.
%F Martin and Kearney (2015) give both a recurrence and a g.f.
%F The recurrence is a(0)=-1, a(1)=0; a(n) = (n-1)*a(n-1) + (n-3)*a(n-2) + Sum_{j=1..n-1} a(j)*a(n-j).
%F a(n) ~ n!/exp(1) * (1 - 2/n^2 - 6/n^3 - 29/n^4 - 196/n^5 - 1665/n^6 - 16796/n^7 - 194905/n^8 - 2549468/n^9 - 37055681/n^10), for coefficients see A260578. - _Vaclav Kotesovec_, Jul 28 2015
%F G.f.: -1 + x^2/(1 - 2*x - 4*x^2/(1 - 4*x - 9*x^2/(1 - 6*x - 16*x^2/(1 - ...)))), a continued fraction. - _Ilya Gutkovskiy_, Aug 22 2018
%e There are 9 derangements of 1,2,3,4. All of them are indecomposable except for 2,1,4,3. Thus a(4) = 8. - _Eric M. Schmidt_, Jul 10 2015
%t Clear[a]; a[0]=-1; a[1]=0; a[n_]:=a[n]=(n-1)*a[n-1] + (n-3)*a[n-2] + Sum[a[j]*a[n-j],{j,1,n-1}]; Table[a[n],{n,0,20}] (* _Vaclav Kotesovec_, Jul 29 2015 *)
%t nmax = 25; CoefficientList[Assuming[Element[x, Reals], Series[-x*E^(1 + 1/x)/ExpIntegralEi[1 + 1/x], {x, 0, nmax}]], x] (* _Vaclav Kotesovec_, Aug 05 2015 *)
%o (Sage)
%o def a(n) : return -1 if n==0 else 0 if n==1 else (n-1)*a(n-1) + (n-3)*a(n-2) + sum(a(j)*a(n-j) for j in [1..n-1]) # _Eric M. Schmidt_, Jul 10 2015
%Y Cf. A000166, A259870, A259871, A259872, A260578.
%K sign,easy
%O 0,4
%A _N. J. A. Sloane_, Jul 09 2015
%E More terms from and definition edited by _Eric M. Schmidt_, Jul 10 2015