A002627 a(n) = n*a(n-1) + 1, a(0) = 0.
0, 1, 3, 10, 41, 206, 1237, 8660, 69281, 623530, 6235301, 68588312, 823059745, 10699776686, 149796873605, 2246953104076, 35951249665217, 611171244308690, 11001082397556421, 209020565553572000, 4180411311071440001, 87788637532500240022
Offset: 0
Examples
[a(0), a(1), ...] = GAMMA(m+1,1)*exp(1) - GAMMA(m+1) = [exp(-1)*exp(1)-1, 2*exp(-1)*exp(1)-1, 5*exp(-1)*exp(1)-2, 16*exp(-1)*exp(1)-6, 65*exp(-1)*exp(1)-24, 326*exp(-1)*exp(1)-120, ...]. - _Stephen Crowley_, Jul 24 2009 From _Daniel Forgues_, Apr 25 2011: (Start) n=0: {}: #{} = 0 n=1: {1}: #{()} = 1 n=2: {1,2}: #{(),(1),(2)} = 3 n=3: {1,2,3}: #{(),(1),(2),(3),(1,2),(2,1),(1,3),(3,1),(2,3),(3,2)} = 10 (End) x + 3*x^2 + 10*x^3 + 41*x^4 + 206*x^5 + 1237*x^6 + 8660*x^7 + 69281*x^8 + ...
References
- D. Singh, The numbers L(m,n) and their relations with prepared Bernoulli and Eulerian numbers, Math. Student, 20 (1952), 66-70.
- N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
- N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
Links
- Seiichi Manyama, Table of n, a(n) for n = 0..449 (terms 0..100 from T. D. Noe)
- Sanka Balasuriya, Igor E. Shparlinski and Arne Winterhof, An average bound for character sums with some counter-dependent recurrence sequences, Rocky Mt. J. Math. 39, No. 5, 1403-1409 (2009).
- Elena Barcucci, Alberto Del Lungo, and Renzo Pinzani, "Deco" polyominoes, permutations and random generation, Theoretical Computer Science, 159, 1996, 29-42.
- Jonathan Beagley and Lara Pudwell, Colorful Tilings and Permutations, Journal of Integer Sequences, Vol. 24 (2021), Article 21.10.4.
- Jimmy Devillet, Bisymmetric and quasitrivial operations: characterizations and enumerations, arXiv:1712.07856 [math.RA], 2017.
- INRIA Algorithms Project, Encyclopedia of Combinatorial Structures 150
- Nicholas Kapoor and P. Christopher Staecker, Ahead of the Count: An Algorithm for Probabilistic Prediction of Instant Runoff (IRV) Elections, arXiv:2405.09009 [cs.CY], 2024. See p. 11.
- Daljit Singh, The numbers L(m,n) and their relations with prepared Bernoulli and Eulerian numbers, Math. Student, 20 (1952), 66-70. [Annotated scanned copy]
- Jun Yan, Results on pattern avoidance in parking functions, arXiv:2404.07958 [math.CO], 2024. See p. 5.
Crossrefs
Programs
-
Haskell
a002627 n = a002627_list !! n a002627_list = 0 : map (+ 1) (zipWith (*) [1..] a002627_list) -- Reinhard Zumkeller, Mar 24 2013
-
Magma
I:=[1]; [0] cat [n le 1 select I[n] else n*Self(n-1)+1:n in [1..21]]; // Marius A. Burtea, Aug 07 2019
-
Maple
A002627 := proc(n) add( (n-j)!*binomial(n,j), j=1..n) ; end proc: seq(A002627(n),n=0..21) ; # Zerinvary Lajos, Jul 31 2006
-
Mathematica
FoldList[ #1*#2 + 1 &, 0, Range[21]] (* Robert G. Wilson v, Oct 11 2005 *) RecurrenceTable[{a[0]==0,a[n]==n*a[n-1]+1},a,{n,30}] (* Harvey P. Dale, Mar 29 2015 *)
-
Maxima
makelist(sum(n!/k!,k,1,n),n,0,40); /* Emanuele Munarini, Jun 20 2014 */
-
PARI
a(n)= n!*sum(k=1,n, 1/k!); \\ Joerg Arndt, Apr 24 2011
Formula
a(n) = n! * Sum_{k=1..n} 1/k!.
a(n) = A000522(n) - n!. - Michael Somos, Mar 26 1999
a(n) = floor( n! * (e-1) ), n >= 1. - Amarnath Murthy, Mar 08 2002
E.g.f.: (exp(x)-1)/(1-x). - Mario Catalani (mario.catalani(AT)unito.it), Feb 06 2003
Binomial transform of A002467. - Ross La Haye, Sep 21 2004
a(n) = Sum_{j=1..n} (n-j)!*binomial(n,j). - Zerinvary Lajos, Jul 31 2006
a(n) = 1 + Sum_{k=0..n-1} k*a(k). - Benoit Cloitre, Jul 26 2008
a(m) = Integral_{s=0..oo} ((1+s)^m - s^m)*exp(-s) = GAMMA(m+1,1) * exp(1) - GAMMA(m+1). - Stephen Crowley, Jul 24 2009
From Sergei N. Gladkovskii, Jul 05 2012: (Start)
E.g.f.: Q(0)/(1-x), where Q(k)= 1 + (x-1)*k!/(1 - x/(x + (x-1)*(k+1)!/Q(k+1))); (continued fraction). (End)
E.g.f.: x/(1-x)*E(0)/2, where E(k)= 1 + 1/(1 - x/(x + (k+2)/E(k+1))); (continued fraction). - Sergei N. Gladkovskii, Jun 01 2013
1/(e - 1) = 1 - 1!/(1*3) - 2!/(3*10) - 3!/(10*41) - 4!/(41*206) - ... (see A056542 and A185108). - Peter Bala, Oct 09 2013
Conjecture: a(n) + (-n-1)*a(n-1) + (n-1)*a(n-2) = 0. - R. J. Mathar, Feb 16 2014
The e.g.f. f(x) = (exp(x)-1)/(1-x) satisfies the differential equation: (1-x)*f'(x) - (2-x)*f(x) + 1, from which we can obtain the recurrence:
a(n+1) = a(n) + n! + Sum_{k=1..n} (n!/k!)*a(k). The above conjectured recurrence can be obtained from the original recurrence or from the differential equation satisfied by f(x). - Emanuele Munarini, Jun 20 2014
Limit_{n -> oo} a(n)/n! = exp(1) - 1. - Carmine Suriano, Jul 01 2015
Product_{n>=2} a(n)/(a(n)-1) = exp(1) - 1. See A091131. - James R. Buddenhagen, Jul 21 2019
a(n) = Sum_{k=0..n-1} k!*binomial(n,k). - Ridouane Oudra, Jun 17 2025
Extensions
Comments from Michael Somos
Comments