A024167 a(n) = n!*(1 - 1/2 + 1/3 - ... + c/n), where c = (-1)^(n+1).
1, 1, 5, 14, 94, 444, 3828, 25584, 270576, 2342880, 29400480, 312888960, 4546558080, 57424792320, 948550176000, 13869128448000, 256697973504000, 4264876094976000, 87435019510272000, 1627055289796608000, 36601063093905408000, 754132445894209536000
Offset: 1
Examples
G.f. = x + x^2 + 5*x^3 + 14*x^4 + 94*x^5 + 444*x^6 + 3828*x^7 + 25584*x^8 + ...
Links
- Seiichi Manyama, Table of n, a(n) for n = 1..449
Programs
-
Maple
a := n -> n!*(log(2) - (-1)^n*LerchPhi(-1, 1, n+1)); seq(simplify(a(n)), n=1..20); # Peter Luschny, Dec 27 2018
-
Mathematica
f[k_] := k (-1)^(k + 1) t[n_] := Table[f[k], {k, 1, n}] a[n_] := SymmetricPolynomial[n - 1, t[n]] Table[a[n], {n, 1, 18}] (* A024167 signed *) (* Clark Kimberling, Dec 30 2011 *) a[ n_] := If[ n < 0, 0, n! Sum[ -(-1)^k / k, {k, n}]]; (* Michael Somos, Nov 28 2013 *) a[ n_] := If[ n < 0, 0, n! (PolyGamma[n + 1] - PolyGamma[(n + Mod[n, 2, 1]) / 2])]; (* Michael Somos, Nov 28 2013 *) a[ n_] := If[ n < 1, 0, (-1)^Quotient[n, 2] SymmetricPolynomial[ n - 1, Table[ -(-1)^k k, {k, n}]]]; (* Michael Somos, Nov 28 2013 *)
-
PARI
{a(n) = if( n<0, 0, n! * polcoeff( log(1 + x + x * O(x^n)) / (1 - x), n))}; /* Michael Somos, Mar 02 2004 */
-
PARI
x='x+O('x^33); Vec(serlaplace(log(1+x)/(1-x))) \\ Joerg Arndt, Dec 27 2018
-
Python
def A(): a, b, n = 1, 1, 2 yield(a) while True: yield(a) b, a = a, a + b * n * n n += 1 a = A(); print([next(a) for in range(20)]) # _Peter Luschny, May 19 2020
Formula
E.g.f.: log(1 + x)/(1 - x). - Vladeta Jovovic, Aug 25 2002
a(n) = a(n-1) + a(n-2) * (n-1)^2, n > 1. - Michael Somos, Oct 29 2002
b(n) = n! satisfies the above recurrence with b(1) = 1, b(2) = 2. This gives the finite continued fraction expansion a(n)/n! = 1/(1 + 1^2/(1 + 2^2/(1 + 3^2/(1 + ... + (n-1)^2/1)))). Cf. A142979. - Peter Bala, Jul 17 2008
E.g.f.: (x/(x-1))/G(0) where G(k) = -1 + (x-1)*k + x*(k+1)^2/G(k+1); (continued fraction, Euler's 1st kind, 1-step). - Sergei N. Gladkovskii, Aug 18 2012
a(n) ~ log(2)*n!. - Daniel Suteu, Dec 03 2016
a(n) = (1/2)*n!*((-1)^n*(digamma((n+1)/2) - digamma((n+2)/2)) + log(4)). - Daniel Suteu, Dec 03 2016
a(n) = n!*(log(2) - (-1)^n*LerchPhi(-1, 1, n+1)). - Peter Luschny, Dec 27 2018
a(n) = A054651(n,n-1). - Pontus von Brömssen, Oct 25 2020
a(n) = Sum_{k=0..n} (-1)^k*k!*A094587(n, k+1). - Mélika Tebni, Jun 20 2022
a(n) = n * a(n-1) - (-1)^n * (n-1)! for n > 1. - Werner Schulte, Oct 20 2024
Extensions
More terms from Benoit Cloitre, Jan 27 2002
a(21)-a(22) from Pontus von Brömssen, Oct 25 2020
Comments