cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A002627 a(n) = n*a(n-1) + 1, a(0) = 0.

This page as a plain text file.
%I A002627 M2858 N1149 #186 Jun 17 2025 10:11:36
%S A002627 0,1,3,10,41,206,1237,8660,69281,623530,6235301,68588312,823059745,
%T A002627 10699776686,149796873605,2246953104076,35951249665217,
%U A002627 611171244308690,11001082397556421,209020565553572000,4180411311071440001,87788637532500240022
%N A002627 a(n) = n*a(n-1) + 1, a(0) = 0.
%C A002627 This sequence shares divisibility properties with A000522; each of the primes in A072456 divide only a finite number of terms of this sequence. - _T. D. Noe_, Jul 07 2005
%C A002627 Sum of the lengths of the first runs in all permutations of [n]. Example: a(3)=10 because the lengths of the first runs in the permutation (123),(13)2,(3)12,(2)13,(23)1 and (3)21 are 3,2,1,1,2 and 1, respectively (first runs are enclosed between parentheses). Number of cells in the last columns of all deco polyominoes of height n. A deco polyomino is a directed column-convex polyomino in which the height, measured along the diagonal, is attained only in the last column. a(n) = Sum_{k=1..n} k*A092582(n,k). - _Emeric Deutsch_, Aug 16 2006
%C A002627 Starting with offset 1 = eigensequence of an infinite lower triangular matrix with (1, 2, 3, ...) as the right border, (1, 1, 1, ...) as the left border, and the rest zeros. - _Gary W. Adamson_, Apr 27 2009
%C A002627 Sums of rows of the triangle in A173333, n > 0. - _Reinhard Zumkeller_, Feb 19 2010
%C A002627 if s(n) is a sequence defined as s(0) = x, s(n) = n*s(n-1)+k, n > 0 then s(n) = n!*x + a(n)*k. - _Gary Detlefs_, Feb 20 2010
%C A002627 Number of arrangements of proper subsets of n distinct objects, i.e., arrangements which are not permutations (where the empty set is considered a proper subset of any nonempty set); see example. - _Daniel Forgues_, Apr 23 2011
%C A002627 For n >= 0, A002627(n+1) is the sequence of sums of Pascal-like triangle with one side 1,1,..., and the other side A000522. - _Vladimir Shevelev_, Feb 06 2012
%C A002627 a(n) = q(n,1) for n >= 1, where the polynomials q are defined at A248669. - _Clark Kimberling_, Oct 11 2014
%C A002627 a(n) is the number of quasilinear weak orderings on {1,...,n}. - _J. Devillet_, Dec 22 2017
%D A002627 D. Singh, The numbers L(m,n) and their relations with prepared Bernoulli and Eulerian numbers, Math. Student, 20 (1952), 66-70.
%D A002627 N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
%D A002627 N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
%H A002627 Seiichi Manyama, <a href="/A002627/b002627.txt">Table of n, a(n) for n = 0..449</a> (terms 0..100 from T. D. Noe)
%H A002627 Sanka Balasuriya, Igor E. Shparlinski and Arne Winterhof, <a href="https://doi.org/10.1216/RMJ-2009-39-5-1403">An average bound for character sums with some counter-dependent recurrence sequences</a>, Rocky Mt. J. Math. 39, No. 5, 1403-1409 (2009).
%H A002627 Elena Barcucci, Alberto Del Lungo, and Renzo Pinzani, <a href="http://dx.doi.org/10.1016/0304-3975(95)00199-9">"Deco" polyominoes, permutations and random generation</a>, Theoretical Computer Science, 159, 1996, 29-42.
%H A002627 Jonathan Beagley and Lara Pudwell, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL24/Pudwell/pudwell13.html">Colorful Tilings and Permutations</a>, Journal of Integer Sequences, Vol. 24 (2021), Article 21.10.4.
%H A002627 Jimmy Devillet, <a href="https://arxiv.org/abs/1712.07856">Bisymmetric and quasitrivial operations: characterizations and enumerations</a>, arXiv:1712.07856 [math.RA], 2017.
%H A002627 INRIA Algorithms Project, <a href="http://ecs.inria.fr/services/structure?nbr=150">Encyclopedia of Combinatorial Structures 150</a>
%H A002627 Nicholas Kapoor and P. Christopher Staecker, <a href="https://arxiv.org/abs/2405.09009">Ahead of the Count: An Algorithm for Probabilistic Prediction of Instant Runoff (IRV) Elections</a>, arXiv:2405.09009 [cs.CY], 2024. See p. 11.
%H A002627 Daljit Singh, <a href="/A002627/a002627.pdf">The numbers L(m,n) and their relations with prepared Bernoulli and Eulerian numbers</a>, Math. Student, 20 (1952), 66-70. [Annotated scanned copy]
%H A002627 Jun Yan, <a href="https://arxiv.org/abs/2404.07958">Results on pattern avoidance in parking functions</a>, arXiv:2404.07958 [math.CO], 2024. See p. 5.
%F A002627 a(n) = n! * Sum_{k=1..n} 1/k!.
%F A002627 a(n) = A000522(n) - n!. - _Michael Somos_, Mar 26 1999
%F A002627 a(n) = floor( n! * (e-1) ), n >= 1. - _Amarnath Murthy_, Mar 08 2002
%F A002627 E.g.f.: (exp(x)-1)/(1-x). - Mario Catalani (mario.catalani(AT)unito.it), Feb 06 2003
%F A002627 Binomial transform of A002467. - _Ross La Haye_, Sep 21 2004
%F A002627 a(n) = Sum_{j=1..n} (n-j)!*binomial(n,j). - _Zerinvary Lajos_, Jul 31 2006
%F A002627 a(n) = 1 + Sum_{k=0..n-1} k*a(k). - _Benoit Cloitre_, Jul 26 2008
%F A002627 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
%F A002627 From _Sergei N. Gladkovskii_, Jul 05 2012: (Start)
%F A002627 a(n+1) = A000522(n) + A001339(n) - A000142(n+1);
%F A002627 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)
%F A002627 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
%F A002627 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
%F A002627 Conjecture: a(n) + (-n-1)*a(n-1) + (n-1)*a(n-2) = 0. - _R. J. Mathar_, Feb 16 2014
%F A002627 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:
%F A002627 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
%F A002627 Limit_{n -> oo} a(n)/n! = exp(1) - 1. - _Carmine Suriano_, Jul 01 2015
%F A002627 Product_{n>=2} a(n)/(a(n)-1) = exp(1) - 1. See A091131. - _James R. Buddenhagen_, Jul 21 2019
%F A002627 a(n) = Sum_{k=0..n-1} k!*binomial(n,k). - _Ridouane Oudra_, Jun 17 2025
%e A002627 [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
%e A002627 From _Daniel Forgues_, Apr 25 2011: (Start)
%e A002627   n=0: {}: #{} = 0
%e A002627   n=1: {1}: #{()} = 1
%e A002627   n=2: {1,2}: #{(),(1),(2)} = 3
%e A002627   n=3: {1,2,3}: #{(),(1),(2),(3),(1,2),(2,1),(1,3),(3,1),(2,3),(3,2)} = 10
%e A002627 (End)
%e A002627 x + 3*x^2 + 10*x^3 + 41*x^4 + 206*x^5 + 1237*x^6 + 8660*x^7 + 69281*x^8 + ...
%p A002627 A002627 := proc(n)
%p A002627     add( (n-j)!*binomial(n,j), j=1..n) ;
%p A002627 end proc:
%p A002627 seq(A002627(n),n=0..21) ; # _Zerinvary Lajos_, Jul 31 2006
%t A002627 FoldList[ #1*#2 + 1 &, 0, Range[21]] (* _Robert G. Wilson v_, Oct 11 2005 *)
%t A002627 RecurrenceTable[{a[0]==0,a[n]==n*a[n-1]+1},a,{n,30}] (* _Harvey P. Dale_, Mar 29 2015 *)
%o A002627 (PARI) a(n)= n!*sum(k=1,n, 1/k!); \\ _Joerg Arndt_, Apr 24 2011
%o A002627 (Haskell)
%o A002627 a002627 n = a002627_list !! n
%o A002627 a002627_list = 0 : map (+ 1) (zipWith (*) [1..] a002627_list)
%o A002627 -- _Reinhard Zumkeller_, Mar 24 2013
%o A002627 (Maxima) makelist(sum(n!/k!,k,1,n),n,0,40); /* _Emanuele Munarini_, Jun 20 2014 */
%o A002627 (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
%Y A002627 Cf. A000522, A001113, A092582.
%Y A002627 Second diagonal of A059922, cf. A056542.
%Y A002627 Conjectured to give records in A130147.
%K A002627 nonn,easy,nice
%O A002627 0,3
%A A002627 _N. J. A. Sloane_
%E A002627 Comments from _Michael Somos_