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.

Showing 1-7 of 7 results.

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

Original entry on oeis.org

0, 1, 3, 10, 41, 206, 1237, 8660, 69281, 623530, 6235301, 68588312, 823059745, 10699776686, 149796873605, 2246953104076, 35951249665217, 611171244308690, 11001082397556421, 209020565553572000, 4180411311071440001, 87788637532500240022
Offset: 0

Views

Author

Keywords

Comments

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
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
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
Sums of rows of the triangle in A173333, n > 0. - Reinhard Zumkeller, Feb 19 2010
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
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
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
a(n) = q(n,1) for n >= 1, where the polynomials q are defined at A248669. - Clark Kimberling, Oct 11 2014
a(n) is the number of quasilinear weak orderings on {1,...,n}. - J. Devillet, Dec 22 2017

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).

Crossrefs

Second diagonal of A059922, cf. A056542.
Conjectured to give records in A130147.

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)
a(n+1) = A000522(n) + A001339(n) - A000142(n+1);
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

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

Original entry on oeis.org

0, 1, 4, 17, 86, 517, 3620, 28961, 260650, 2606501, 28671512, 344058145, 4472755886, 62618582405, 939278736076, 15028459777217, 255483816212690, 4598708691828421, 87375465144740000, 1747509302894800001, 36697695360790800022, 807349297937397600485
Offset: 1

Views

Author

Henry Bottomley, Jun 20 2000

Keywords

Comments

For n >= 2 also operation count to create all permutations of n distinct elements using Algorithm L (lexicographic permutation generation) from Knuth's The Art of Computer Programming, Vol. 4, chapter 7.2.1.2. Sequence gives number of loop repetitions of the j search loop in step L2. - Hugo Pfoertner, Feb 06 2003
More directly: sum over all permutations of length n-1 of the product of the length of the first increasing run by the value of the first position. The recurrence follows from this definition. - Olivier Gérard, Jul 07 2011
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
This sequence also represents the number of subdeterminant evaluations when calculation a determinant by Laplace recursive method. - Reinhard Muehlfeld, Sep 14 2010
Also, a(n) equals the number of non-isomorphic directed graphs of n+1 vertices with 1 component, where each vertex has exactly one outgoing edge, excluding loops and cycle graphs. - Stephen Dunn, Nov 30 2019

Examples

			a(4) = 4*a(3) + 1 = 4*4 + 1 = 17.
Permutations of order 3 .. Length of first run * First position
123..3*1
132..2*1
213..1*2
231..2*2
312..1*3
321..1*3
a(4) = 3+2+2+4+3+3 = 17. - _Olivier Gérard_, Jul 07 2011
		

References

  • D. E. Knuth: The Art of Computer Programming, Volume 4, Combinatorial Algorithms, Volume 4A, Enumeration and Backtracking. Pre-fascicle 2B, A draft of section 7.2.1.2: Generating all permutations. Available online; see link.

Crossrefs

Cf. A079751 (same recursion formula, but starting from a(3)=0), A038155, A038156, A080047, A080048, A080049.
Equals the row sums of A162995 triangle (n>=2). - Johannes W. Meijer, Jul 21 2009
Cf. A070213 (indices of primes).

Programs

  • Haskell
    a056542 n = a056542_list !! (n-1)
    a056542_list = 0 : map (+ 1) (zipWith (*) [2..] a056542_list)
    -- Reinhard Zumkeller, Mar 24 2013
    
  • Magma
    [n le 2 select n-1 else n*Self(n-1)+1: n in [1..20]]; // Bruno Berselli, Dec 13 2013
  • Mathematica
    tmp=0; Join[{tmp}, Table[tmp=n*tmp+1, {n, 2, 100}]] (* T. D. Noe, Jul 12 2005 *)
    FoldList[ #1*#2 + 1 &, 0, Range[2, 21]] (* Robert G. Wilson v, Oct 11 2005 *)

Formula

a(n) = floor((e-2)*n!).
a(n) = A002627(n) - n!.
a(n) = A000522(n) - 2*n!.
a(n) = n! - A056543(n).
a(n) = (n-1)*(a(n-1) + a(n-2)) + 2, n > 2. - Gary Detlefs, Jun 22 2010
1/(e - 2) = 2! - 2!/(1*4) - 3!/(4*17) - 4!/(17*86) - 5!/(86*517) - ... (see A002627 and A185108). - Peter Bala, Oct 09 2013
E.g.f.: (exp(x) - 1 - x) / (1 - x). - Ilya Gutkovskiy, Jun 26 2022

Extensions

More terms from James Sellers, Jul 04 2000

A194807 Decimal expansion of 1/(e-2).

Original entry on oeis.org

1, 3, 9, 2, 2, 1, 1, 1, 9, 1, 1, 7, 7, 3, 3, 2, 8, 1, 4, 3, 7, 6, 5, 5, 2, 8, 7, 8, 4, 7, 9, 8, 1, 6, 5, 2, 8, 3, 7, 3, 9, 7, 8, 3, 8, 5, 3, 1, 5, 2, 8, 7, 1, 2, 3, 5, 9, 1, 3, 2, 4, 5, 6, 7, 0, 8, 3, 2, 7, 9, 5, 7, 0, 4, 6, 1, 6, 1, 0, 9, 2, 6, 6, 9, 1, 7, 1, 0, 5, 8, 7, 2, 6, 7, 6, 1, 2, 9, 9, 8, 8, 8, 8, 5, 6
Offset: 1

Views

Author

Martin Janecke, May 06 2012

Keywords

Comments

The value of the continued fraction 1+1/(2+2/(3+3/(4+4/(5+5/(6+6/(...)))))).

Examples

			1.392211191177332814376552878479816528373978385315...
		

Crossrefs

Cf. A073333 (1/(e-1)), A002627, A185108.

Programs

  • Magma
    1/(Exp(1) - 2); // G. C. Greubel, Apr 09 2018
  • Mathematica
    RealDigits[1/(E - 2), 10, 105][[1]] (* T. D. Noe, May 07 2012 *)
    Fold[Function[#2 + #2/#1], 1, Reverse[Range[100]]] // N[#, 105]& // RealDigits // First (* Jean-François Alcover, Sep 19 2014 *)
  • PARI
    default(realprecision,110);
    1/(exp(1)-2)
    \\ Joerg Arndt, May 07 2012
    

Formula

Define s(n) = Sum_{k = 2..n} 1/k! for n >= 2. Then 1/(e - 2) = 2! - Sum_ {n >= 2} 1/( (n+1)!*s(n)*s(n+1) ) is a rapidly converging series of rationals. Cf. A073333. Equivalently, 1/(e - 2) = 2! - 2!/(1*4) - 3!/(4*17) - 4!/(17*86) - ..., where [1, 4, 17, 86, ... ] is A056542. Cf. A002627 and A185108. - Peter Bala, Oct 09 2013

A193361 a(0)=0, a(1)=0; for n>1, a(n) = a(n-1) + (n-3)*a(n-2) + 1.

Original entry on oeis.org

0, 0, 1, 2, 4, 9, 22, 59, 170, 525, 1716, 5917, 21362, 80533, 315516, 1281913, 5383622, 23330405, 104084736, 477371217, 2246811730, 10839493637, 53528916508, 270318789249, 1394426035918, 7341439399397, 39413238225512, 215607783811041, 1200938739448842
Offset: 0

Views

Author

Vincenzo Librandi, Dec 25 2012

Keywords

Crossrefs

Programs

  • Magma
    [n le 2 select 0 else Self(n-1)+(n-4)*Self(n-2) + 1: n in [1..30]];
  • Mathematica
    RecurrenceTable[{a[1]==0,a[2]==0,a[n]==a[n-1]+(n-4) a[n-2]+1},a,{n,30}]

Formula

a(0)=a(1)=0, a(2)=1, a(n) = 2*a(n-1)+(n-4)*a(n-2)-(n-4)*a(n-3).
a(n) ~ (sqrt(Pi)+sqrt(2))/2 * n^(n/2-1)*exp(sqrt(n)-n/2-1/4) * (1-17/(24*sqrt(n))). - Vaclav Kotesovec, Dec 27 2012
a(n) = A187044(n-2). - Vaclav Kotesovec, Feb 14 2014

A220699 a(0)=0, a(1)=0; for n>1, a(n) = a(n-1) + (n-4)*a(n-2) + 1.

Original entry on oeis.org

0, 0, 1, 2, 3, 6, 13, 32, 85, 246, 757, 2480, 8537, 30858, 116229, 455668, 1850417, 7774102, 33679941, 150291472, 689170529, 3244125554, 15649195077, 77287580604, 390271482145, 2013310674830, 10599283282021
Offset: 0

Views

Author

Vincenzo Librandi, Dec 25 2012

Keywords

Crossrefs

Programs

  • Magma
    [n le 2 select 0 else Self(n-1)+(n-5)*Self(n-2) + 1: n in [1..30]];
  • Mathematica
    RecurrenceTable[{a[1]==0, a[2]==0, a[n]==a[n-1] + (n-5) a[n-2] + 1}, a, {n, 40}]

Formula

a(0)=a(1)=0, a(2)=1, a(n) = 2*a(n-1)+(n-5)*a(n-2)-(n-5)*a(n-3).
a(n) ~ (sqrt(Pi)/2+sqrt(2)) * n^(n/2-3/2)*exp(sqrt(n)-n/2-1/4) * (1-29/(24*sqrt(n))). - Vaclav Kotesovec, Dec 27 2012

A220700 a(0)=0, a(1)=0; for n>1, a(n) = a(n-1) + (n+3)*a(n-2) + 1.

Original entry on oeis.org

0, 0, 1, 2, 10, 27, 118, 389, 1688, 6357, 28302, 117301, 541832, 2418649, 11629794, 55165477, 276131564, 1379441105, 7178203950, 37525908261, 202624599112, 1103246397377, 6168861375178, 34853267706981, 201412524836788, 1177304020632257, 7018267240899110
Offset: 0

Views

Author

Vincenzo Librandi, Dec 25 2012

Keywords

Crossrefs

Programs

  • Magma
    [n le 2 select 0 else Self(n-1)+(n+2)*Self(n-2) + 1: n in [1..30]];
  • Mathematica
    RecurrenceTable[{a[0] == 0, a[1] == 0, a[n] == a[n-1] + (n+3) a[n-2] + 1}, a, {n, 0, 40}] (* corrected by Georg Fischer, Dec 05 2019 *)
    FullSimplify[CoefficientList[Series[1/8*E^(-(x^2/2))*(E^(x^2/2)*(3*Sqrt[2*Pi]*Erf[1/Sqrt[2]]*E^(1/2*(x+1)^2)*(x*(x+2)*(x*(x+2)+8)+10)-6*(x+1)*(x*(x+2)+6)-6*E^(1/2*x*(x+2))*(x*(x+2)*(x*(x+2)+8)+10)+8*E^x*(x*(x*(x+4)+11)+12))+Sqrt[2*Pi]*E^(x^2+x)*(x*(x+2)*(x*(x+2)+8)+10)*(4*Erf[x/Sqrt[2]]-3*Sqrt[E]*Erf[(x+1)/Sqrt[2]])), {x, 0, 20}], x]* Range[0, 20]!] (* Vaclav Kotesovec, Dec 27 2012 *)
    nxt[{n_,a_,b_}]:={n+1,b,b+a(n+4)+1}; NestList[nxt,{1,0,0},30][[All,2]] (* Harvey P. Dale, Mar 01 2020 *)

Formula

a(0)=a(1)=0, a(2)=1, a(n) = 2*a(n-1)+(n+2)*a(n-2)-(n+2)*a(n-3).
E.g.f.: 1/8*exp(-(x^2/2))*(exp(x^2/2)*(3*sqrt(2*Pi)*erf(1/sqrt(2))*exp(1/2*(x+1)^2)*(x*(x+2)*(x*(x+2)+8)+10)-6*(x+1)*(x*(x+2)+6)-6*exp(1/2*x*(x+2))*(x*(x+2)*(x*(x+2)+8)+10)+8*exp(x)*(x*(x*(x+4)+11)+12))+sqrt(2*Pi)*exp(x^2+x)*(x*(x+2)*(x*(x+2)+8)+10)*(4*erf(x/sqrt(2))-3*sqrt(exp(1))*erf((x+1)/sqrt(2)))). - Vaclav Kotesovec, Dec 27 2012
a(n) ~ (1/2*sqrt(Pi)-3/(4*sqrt(2))+3/8*sqrt(Pi)*exp(1/2)*(erf(1/sqrt(2))-1)) * n^(n/2+2)*exp(sqrt(n)-n/2-1/4) * (1+55/(24*sqrt(n))). - Vaclav Kotesovec, Dec 27 2012

A365307 Decimal expansion of 1/(2*e-5).

Original entry on oeis.org

2, 2, 9, 0, 6, 1, 6, 6, 9, 2, 7, 8, 5, 3, 6, 2, 4, 2, 2, 1, 0, 7, 5, 3, 3, 4, 1, 4, 5, 6, 1, 8, 4, 5, 0, 2, 5, 7, 8, 2, 0, 6, 8, 7, 3, 8, 6, 9, 0, 7, 3, 4, 6, 6, 5, 0, 5, 7, 1, 3, 1, 4, 9, 5, 0, 9, 9, 4, 1, 8, 8, 0, 3, 0, 4, 8, 7, 0, 1, 0, 8, 2, 5, 0, 1, 1, 9, 3, 9, 9
Offset: 1

Views

Author

Rok Cestnik, Aug 31 2023

Keywords

Comments

The continued fraction expansion is A081750 with initial term 5 omitted.

Examples

			2.2906166927853624221...
		

Crossrefs

Programs

  • Mathematica
    A365307 = RealDigits[N[1/(2*E-5),#+1]][[1]][[1;;-2]]&;
  • PARI
    1/(2*exp(1)-5).

Formula

Equals 2 + 1/(3 + 2/(4 + 3/(5 + 4/(6 + 5/( ... /(n+1 + n/(n+2 + ... ))))))).
From Peter Bala, Oct 23 2023: (Start)
Define s(n) = Sum_{k = 3..n} 1/k!. Then 1/(2*e - 5) = 3 - (1/2)*Sum_{n >= 3 } 1/( (n+1)!*s(n)*s(n+1) ) is a rapidly converging series of rationals. Cf. A073333 and A194807.
Equivalently, 1/(2*e - 5) = 3 - (1/2)*(3!/(1*5) + 4!/(5*26) + 5!/(26*157) + 6!/(157*1100) + ...), where [1, 5, 26, 157, 1100, ... ] is A185108. (End)
Showing 1-7 of 7 results.