login
a(n) = n! * (1 + Sum_{j=1..n} (-1)^j/j).
11

%I #40 Sep 25 2023 17:28:52

%S 1,0,1,1,10,26,276,1212,14736,92304,1285920,10516320,166112640,

%T 1680462720,29753498880,359124192000,7053661440000,98989454592000,

%U 2137497610752000,34210080898560000,805846718380032000,14489879077804032000,369868281883398144000

%N a(n) = n! * (1 + Sum_{j=1..n} (-1)^j/j).

%C a(n) is the number of permutations of n letters all cycles of which have length <= n/2, a quantity which arises in the solution to the One Hundred Prisoners problem. - Jim Ferry (jferry(AT)alum.mit.edu), Mar 29 2007

%H Alois P. Heinz, <a href="/A024168/b024168.txt">Table of n, a(n) for n = 0..450</a>

%H Wikipedia, <a href="http://en.wikipedia.org/wiki/Random_Permutation_Statistics#One_hundred_prisoners">One hundred prisoners</a>.

%H <a href="/index/Fa#factorial">Index entries for sequences related to factorial numbers</a>

%F From _Michael Somos_, Oct 29 2002: (Start)

%F E.g.f.: (log(x+1)-1)/(x-1).

%F a(n) = a(n-1)+a(n-2)*(n-1)^2, n>=2. (End)

%F a(0) = 1, a(n) = a(n-1)*n + (-1)^n*(n-1)!. - _Daniel Suteu_, Feb 06 2017

%F a(n) = n!*((-1)^n*LerchPhi(-1, 1, n+1) + 1 - log(2)). - _Peter Luschny_, Dec 27 2018

%F Limit_{n->oo} a(n)/n! = 1 - log(2) = A244009. - _Alois P. Heinz_, Jul 08 2022

%p a := n -> n!*((-1)^n*LerchPhi(-1, 1, n + 1) + 1 - log(2));

%p seq(simplify(a(n)), n=0..21); # _Peter Luschny_, Dec 27 2018

%t f[k_] := (k + 1) (-1)^(k + 1)

%t t[n_] := Table[f[k], {k, 1, n}]

%t a[n_] := SymmetricPolynomial[n - 1, t[n]]

%t Table[a[n], {n, 1, 22}] (* A024168 signed *)

%t (* _Clark Kimberling_, Dec 30 2011 *)

%o (PARI) x='x+O('x^33); concat([0],Vec(serlaplace((x-log(1+x))/(1-x)))) \\ _Joerg Arndt_, Dec 27 2018

%Y A075829(n) = a(n-1)/gcd(a(n-1), a(n)).

%Y Cf. A000142, A024167, A244009.

%K nonn

%O 0,5

%A _Clark Kimberling_

%E More terms from _Michael Somos_, Oct 29 2002

%E a(0)=1 prepended and edited by _Alois P. Heinz_, Sep 24 2023