A003149 a(n) = Sum_{k=0..n} k!*(n - k)!.
1, 2, 5, 16, 64, 312, 1812, 12288, 95616, 840960, 8254080, 89441280, 1060369920, 13649610240, 189550368000, 2824077312000, 44927447040000, 760034451456000, 13622700994560000, 257872110354432000, 5140559166898176000, 107637093007589376000, 2361827297364885504000
Offset: 0
References
- I. P. Goulden and D. M. Jackson, Combinatorial Enumeration, Wiley, N.Y., 1983, (1.1.11 b, p.342).
- N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
- R. P. Stanley, Enumerative Combinatorics, Volume 1 (1986), p. 49. [From Emeric Deutsch, Oct 28 2008]
Links
- T. D. Noe, Table of n, a(n) for n = 0..100
- Joerg Arndt, Generating Random Permutations, PhD thesis, Australian National University, Canberra, Australia, (2010).
- Fred Curtis, Resistance-network Problems.
- Bakir Farhi, On a curious integer sequence, arXiv:2204.10136 [math.NT], 2022.
- Todd Feil, Gary Kennedy and David Callan, Problem E3467, Amer. Math. Monthly, 100 (1993), 800-801. [From _Emeric Deutsch_, Oct 28 2008]
- Henry W. Gould, Letter to N. J. A. Sloane, Nov 1973, and various attachments.
- IBM, "Ponder This" puzzle for April, 2006
- T. Mansour and J. West, Avoiding 2-letter signed patterns, arXiv:math/0207204 [math.CO], 2002.
- F. Nedemeyer and Y. Smorodinsky, Resistance in the multidimensional cube, Quantum 7:1 (1996) 12-15 and 63.
- R. Sprugnoli, Moments of Reciprocals of Binomial Coefficients, Journal of Integer Sequences, 14 (2011), #11.7.8.
- V. Strehl, The average number of splitters in a random permutation [Unpublished; included here with the author's permission.]
- B. Sury, Sum of the reciprocals of the binomial coefficients, Europ. J. Comb., 14 (1993), 351-353.
- Eric Weisstein's World of Mathematics, Incomplete Beta Function.
- Eric Weisstein's World of Mathematics, Lerch Transcendent.
- Index to sequences related to resistances.
Crossrefs
Programs
-
GAP
F:=Factorial;; List([0..20], n-> Sum([0..n], k-> F(k)*F(n-k)) ); # G. C. Greubel, Dec 29 2019
-
Magma
F:=Factorial; [ (&+[F(k)*F(n-k): k in [0..n]]): n in [0..20]]; // G. C. Greubel, Dec 29 2019
-
Maple
seq( add(k!*(n-k)!, k=0..n), n=0..20); # G. C. Greubel, Dec 29 2019 # second Maple program: a:= proc(n) option remember; `if`(n<2, n+1, ((3*n+1)*a(n-1)-n^2*a(n-2))/2) end: seq(a(n), n=0..22); # Alois P. Heinz, Aug 08 2025
-
Mathematica
Table[Sum[k!(n-k)!,{k,0,n}],{n,0,20}] (* Harvey P. Dale, Mar 28 2012 *) Table[(n+1)!/2^n*Sum[2^k/(k+1),{k,0,n}],{n,0,20}] (* Vaclav Kotesovec, Oct 27 2012 *) Round@Table[-2 (n+1)! Re[LerchPhi[2, 1, n+2]], {n, 0, 20}] (* Vladimir Reshetnikov, Nov 12 2015 *) Table[(n+1)!*Sum[Binomial[n+1, 2*j+1]/(2*j+1), {j, 0, n}]/2^n, {n, 0, 20}] (* Vaclav Kotesovec, Dec 04 2015 *) Series[Exp[-2x] ExpIntegralEi[x]^2, {x, Infinity, 20}][[3]] (* Vladimir Reshetnikov, Apr 24 2016 *) Table[2*(-1)^n * Sum[(2^k - 1) * StirlingS1[n, k] * BernoulliB[k], {k, 0, n}], {n, 1, 25}] (* Vaclav Kotesovec, Oct 04 2022 *)
-
PARI
a(n)=sum(k=0,n,k!*(n-k)!)
-
PARI
a(n)=if(n<0,0,(n+1)!*polcoeff(log(1-x+x^2*O(x^n))/(x/2-1),n+1))
-
PARI
a(n) = my(A = 1, B = 1); for(k=1, n, B *= k; A = (n-k+1)*A + B); A \\ Mikhail Kurkov, Aug 08 2025
-
Python
def a(n: int) -> int: if n < 2: return n + 1 app, ap = 1, 2 for i in range(2, n + 1): app, ap = ap, ((3 * i + 1) * ap - (i * i) * app) >> 1 return ap print([a(n) for n in range(23)]) # Peter Luschny, Aug 08 2025
-
Sage
f=factorial; [sum(f(k)*f(n-k) for k in (0..n)) for n in (0..20)] # G. C. Greubel, Dec 29 2019
Formula
a(n) = n! + ((n+1)/2)*a(n-1), n >= 1. - Leroy Quet, Sep 06 2002
a(n) = ((3n+1)*a(n-1) - n^2*a(n-2))/2, n >= 2. - David W. Wilson, Sep 06 2002; corrected by N. Sato, Jan 27 2010
G.f.: (Sum_{k>=0} k!*x^k)^2. - Vladeta Jovovic, Aug 30 2002
E.g.f: log(1-x)/(x/2 - 1) if offset 1.
Convolution of A000142 [factorial numbers] with itself. - Ross La Haye, Oct 29 2004
a(n) = Sum_{k=0..n+1} k*A145878(n+1,k). - Emeric Deutsch, Oct 28 2008
a(n) = A084938(n+2,2). - Philippe Deléham, Dec 17 2008
a(n) = 2*Integral_{t=0..oo} Ei(t)*exp(-2*t)*t^(n+1) where Ei is the exponential integral function. - Groux Roland, Dec 09 2010
Empirical: a(n-1) = 2^(-n)*(A103213(n) + n!*H(n)) with H(n) harmonic number of order n. - Groux Roland, Dec 18 2010; offset fixed by Vladimir Reshetnikov, Apr 24 2016
O.g.f.: 1/(1-I(x))^2 where I(x) is o.g.f. for A003319. - Geoffrey Critzer, Apr 27 2012
a(n) ~ 2*n!. - Vaclav Kotesovec, Oct 04 2012
a(n) = (n+1)!/2^n * Sum_{k=0..n} 2^k/(k+1). - Vaclav Kotesovec, Oct 27 2012
E.g.f.: 2/((x-1)*(x-2)) + 2*x/(x-2)^2*G(0) where G(k) = 1 + x*(2*k+1)/(2*(k+1) - 4*x*(k+1)^2/(2*x*(k+1) + (2*k+3)/G(k+1) )); (recursively defined continued fraction). - Sergei N. Gladkovskii, Dec 14 2012
a(n) = 2 * n! * (1 + Sum_{k>=1} A005649(k-1)/n^k). - Vaclav Kotesovec, Aug 01 2015
From Vladimir Reshetnikov, Nov 12 2015: (Start)
a(n) = -(n+1)!*Re(Beta(2; n+2, 0))/2^(n+1), where Beta(z; a, b) is the incomplete Beta function.
a(n) = -2*(n+1)!*Re(LerchPhi(2, 1, n+2)), where LerchPhi(z, s, a) is the Lerch transcendent. (End)
a(n) = (n+1)!*(H(n+1) + (n+1)*hypergeom([1, 1, -n], [2, 2], -1))/2^(n+1), where H(n) is the harmonic number. - Vladimir Reshetnikov, Apr 24 2016
Expansion of square of continued fraction 1/(1 - x/(1 - x/(1 - 2*x/(1 - 2*x/(1 - 3*x/(1 - 3*x/(1 - ...))))))). - Ilya Gutkovskiy, Apr 19 2017
a(n) = Sum_{k=0..n+1} (-1)^(n-k)*A226158(k)*Stirling1(n+1, k). - Mélika Tebni, Feb 22 2022
E.g.f.: x/((1-x)*(2-x))-(2*log(1-x))/(2-x)^2+1/(1-x). - Vladimir Kruchinin, Dec 17 2022
Extensions
More terms from Michel ten Voorde, Apr 11 2001
Comments