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-10 of 17 results. Next

A070213 Numbers k such that A056542(k) is prime.

Original entry on oeis.org

4, 8, 18, 20, 70
Offset: 1

Views

Author

Tom Mueller (muel4503(AT)uni-trier.de), May 07 2002

Keywords

Comments

The 6th term (if it exists) is larger than 1019.
No additional primes for n < 14000. - T. D. Noe, Jul 07 2005
a(6) > 25000. - Michael S. Branicky, Apr 16 2025

Crossrefs

Cf. A056542.

Extensions

a(5) from Tom Mueller (muel4503(AT)uni-trier.de), Oct 30 2004
Name clarified by Sean A. Irvine, Jun 02 2024

A110915 Primes in sequence a(n) = n*a(n-1) + 1, a(1) = 0 (A056542).

Original entry on oeis.org

17, 28961, 4598708691828421, 1747509302894800001, 8603990361433692835766763032506384134769654780784715495311087517908153547994512075361554378508046501
Offset: 1

Views

Author

Paul Muljadi, Oct 09 2005

Keywords

Crossrefs

Cf. A056542; indices of a(n) which are primes: A070213.

Programs

  • Mathematica
    Select[ FoldList[ #1*#2 + 1 &, 0, Range[2, 100]], PrimeQ[ # ] &] (* Robert G. Wilson v *)

Extensions

a(5) from Robert G. Wilson v, Oct 11 2005

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

A038156 a(n) = n! * Sum_{k=1..n-1} 1/k!.

Original entry on oeis.org

0, 0, 2, 9, 40, 205, 1236, 8659, 69280, 623529, 6235300, 68588311, 823059744, 10699776685, 149796873604, 2246953104075, 35951249665216, 611171244308689, 11001082397556420, 209020565553571999, 4180411311071440000, 87788637532500240021, 1931350025715005280484
Offset: 0

Views

Author

Keywords

Comments

Related to number of operations of addition and multiplication to evaluate a determinant of order n by cofactor expansion - see A026243.
Also number of operations needed 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 comparisons required to find j in step L2 (see answer to exercise 5). - Hugo Pfoertner, Jan 24 2003
For n>1, the number of possible ballots where there are n candidates and voters may identify their top m most preferred ones, where 0 < m < n. - Shaye Horwitz, Jun 28 2011
For n > 1, a(n) is the expected number of comparisons required to sort a random list of n distinct elements using the "bogosort" algorithm. - Andrew Slattery, Jun 02 2022
The number of permutations of all proper nonempty subsets of an n element set. - P. Christopher Staecker, May 09 2024

Examples

			a(2) = floor((2.718... - 1)*2) - 1 = 3 - 1 = 2,
a(3) = floor((2.718... - 1)*6) - 1 = 10 - 1 = 9.
		

References

  • D. E. Knuth: The Art of Computer Programming, Volume 4, Fascicle 2. Generating All Tuples and Permutations, Addison-Wesley, 2005.

Crossrefs

Programs

Formula

a(n) = floor((e-1)*n!) - 1.
a(0) = a(1) = 0, a(n) = n*(a(n-1) + 1) for n>1. - Philippe Deléham, Oct 16 2009
E.g.f.: (exp(x) - 1)*x/(1 - x). - Ilya Gutkovskiy, Jan 26 2017
a(n) = A002627(n)-1, n>=1. - R. J. Mathar, Jan 03 2018
a(n) = A000522(n)-n!-1, n>=1. - P. Christopher Staecker, May 09 2024

Extensions

a(28) ff. corrected by Georg Fischer, Apr 11 2020

A038155 a(n) = (n!/2) * Sum_{k=0..n-2} 1/k!.

Original entry on oeis.org

0, 0, 1, 6, 30, 160, 975, 6846, 54796, 493200, 4932045, 54252550, 651030666, 8463398736, 118487582395, 1777313736030, 28437019776600, 483429336202336, 8701728051642201, 165332832981201990, 3306656659624039990, 69439789852104840000
Offset: 0

Views

Author

Keywords

Comments

For n>=2, a(n) gives the 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 the number of comparisons required to find the first interchangeable element in step L3 (see answer to exercise 5). - Hugo Pfoertner, Jan 27 2003
a(n) mod 5 = A011658(n+1). - G. C. Greubel, Apr 13 2016
a(450) has 1001 decimal digits. - Michael De Vlieger, Apr 13 2016
Also the number of (undirected) paths in the complete graph K_n. - Eric W. Weisstein, Jun 04 2017

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

Programs

  • Maple
    A038155:=n->(n!/2)*add(1/k!, k=0..n-2): seq(A038155(n), n=0..30); # Wesley Ivan Hurt, Apr 16 2016
  • Mathematica
    RecurrenceTable[{a[0] == 0, a[n] == Sum[a[n - 1] + k, {k, 0, n - 1}]}, a, {n, 21}] (* Ilya Gutkovskiy, Apr 13 2016 *)
    Table[(n!/2) Sum[1/k!, {k, 0, n - 2}], {n, 0, 21}] (* Michael De Vlieger, Apr 13 2016 *)
    Table[1/2 E (n - 1) n Gamma[n - 1, 1], {n, 0, 20}] (* Eric W. Weisstein, Jun 04 2017 *)
    Table[If[n == 0, 0, Floor[n! E - n - 1]/2], {n, 0, 20}] (* Eric W. Weisstein, Jun 04 2017 *)

Formula

a(n) = 1/2*floor(n!*exp(1)-n-1), n>0. - Vladeta Jovovic, Aug 18 2002
E.g.f.: x^2/2*exp(x)/(1-x). - Vladeta Jovovic, Aug 25 2002
a(n) = Sum_{k=0..n-1} a(n-1) + k, a(0)=0. - Ilya Gutkovskiy, Apr 13 2016
a(n) = A038154(n)/2. - Alois P. Heinz, Jan 26 2017

A007808 Number of directed column-convex polyominoes of height n: a(k+1)=(k+1)*a(k)+(a(1)+...+a(k)).

Original entry on oeis.org

1, 1, 3, 13, 69, 431, 3103, 25341, 231689, 2345851, 26065011, 315386633, 4128697741, 58145826519, 876660153671, 14089181041141, 240455356435473, 4343224875615731, 82776756452911579, 1660133837750060001, 34950186057896000021, 770651602576606800463
Offset: 0

Views

Author

Keywords

Comments

a(n) is also the number of outcomes to a race with n contestants in which there is at most one tie (of at least two contestants). - Walden Freedman, Aug 21 2014
Let M(n) denote the n X n matrix with ones along the subdiagonal, ones everywhere above the main diagonal, the integers 3, 4, etc., along the main diagonal, and zeros everywhere else. Then equals a(n) equals the permanent of M(n-1) for n >= 2. - John M. Campbell, Apr 20 2021

Examples

			1 + x + 3*x^2 + 13*x^3 + 69*x^4 + 431*x^5 + 3103*x^6 + 25341*x^7 + 231689*x^8 + ...
		

Crossrefs

Cf. A056542.

Programs

  • Maple
    a:=n->n!*n*(1-add(1/j/(j+1)/(j+1)!,j=1..n-1)): seq(a(n),n=1..22); # Emeric Deutsch, Aug 07 2006
    # second Maple program:
    a:= proc(n) option remember; `if`(n<2, 1,
          (n^2*a(n-1)-1)/(n-1))
        end:
    seq(a(n), n=0..23);  # Alois P. Heinz, Sep 03 2020
  • Mathematica
    a[ n_] := If[ n<0, 0, n! SeriesCoefficient[ (Exp[x] - 2 x) / (1 - x)^2, {x, 0, n}]] (* Michael Somos, Oct 20 2011 *)
    a[n_] := n! + n!*Sum[(n - j)/(j + 1)!, {j, 1, n - 1}] (* Walden Freedman, Aug 21 2014 *)
  • PARI
    {a(n) = if( n<0, 0, n! * polcoeff( (exp(x + x * O(x^n)) - 2 * x) / (1 - x)^2, n))} /* Michael Somos, Oct 20 2011 */

Formula

E.g.f.: (exp(x) - 2 * x) / (1 - x)^2. - Michael Somos, Oct 20 2011
a(n) = A056542(n+1) - A056542(n).
a(n) = (a(n-1)^2 - 2 * a(n-2)^2 + a(n-2) * a(n-3) - 4 * a(n-1) * a(n-3)) / (a(n-2) - a(n-3)) if n>3. - Michael Somos, Oct 20 2011
a(n) = (n^2*a(n-1)-1)/(n-1). - Vladeta Jovovic, Apr 26 2003
a(n) = n!*n*(1-Sum_{j=1..n-1} 1/(j*(j+1)*(j+1)!)). - Emeric Deutsch, Aug 07 2006
Conjectures: E.g.f.: (-(x^2+1)*exp(-x)+1)*exp(x)/(-1+x)^2; a(n) = round(n!*n*(exp(1)-2)). - Simon Plouffe, Dec 08 2009
a(n) = n! + n!*Sum_{j=1..n-1} (n-j)/(j+1)!. - Walden Freedman, Aug 21 2014
Asymptotic approximation: a(n) ~ n!(1 + (n - 1)(e - 2)). - Walden Freedman, Aug 23 2014

Extensions

Added a(0) = 1. - Michael Somos, Oct 20 2011

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

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

Original entry on oeis.org

0, 1, 5, 26, 157, 1100, 8801, 79210, 792101, 8713112, 104557345, 1359245486, 19029436805, 285441552076, 4567064833217, 77640102164690, 1397521838964421, 26552914940324000, 531058298806480001, 11152224274936080022
Offset: 0

Views

Author

Olivier Gérard, Nov 02 2012

Keywords

Crossrefs

Programs

  • Magma
    [n le 1 select 0 else (n+1) * Self(n-1) + 1: n in [1..20]]; // Vincenzo Librandi, Dec 22 2012
  • Mathematica
    RecurrenceTable[{a[0]==0, a[n]==(n+2)*a[n-1] + 1}, a, {n, 20}] (* Vincenzo Librandi, Dec 23 2012 *)
    nxt[{n_,a_}]:={n+1,a(n+3)+1}; NestList[nxt,{0,0},20][[;;,2]] (* Harvey P. Dale, Aug 03 2023 *)

Formula

a(n) = e*Gamma(n+3,1)-(5/2)*(n+2)!, where Gamma(a,x) is the incomplete gamma function. [Bruno Berselli, Dec 24 2012]
Recurrence: a(n) = (n+3)*a(n-1) - (n+1)*a(n-2). - Vaclav Kotesovec, Aug 13 2013
a(n) ~ (exp(1)-5/2)*sqrt(2*Pi)*exp(-n)*n^(n+5/2). - Vaclav Kotesovec, Aug 13 2013
From Peter Bala, Oct 09 2013: (Start)
a(n) = A000522(n+2) - 5/2*(n + 2)! = (n + 2)!*( (sum {k = 0..n + 2} 1/k!) - 5/2 ).
a(n) = floor((n + 2)!*(e - 5/2)).
E.g.f.: ((x^2 - 4*x + 5)*exp(x) - 5)/(1 - x)^3 = x + 5*x^2/2! + 26*x^3/3! + ....
1/(e - 5/2) = 3! - 3!/(1*5) - 4!/(5*26) - 5!/(26*157) - 6!/(157*1100) - .... (see A002627, A056542). (End)

Extensions

Edited by Vincenzo Librandi and N. J. A. Sloane, Dec 24 2012

A186757 Triangle read by rows: T(n,k) is the number of permutations of {1,2,...,n} having k increasing cycles of length >=2 (0<=k<= n/2). A cycle (b(1), b(2), ...) is said to be increasing if, when written with its smallest element in the first position, it satisfies b(1) < b(2) < b(3) < ... .

Original entry on oeis.org

1, 1, 1, 1, 2, 4, 10, 11, 3, 59, 36, 25, 363, 212, 130, 15, 2491, 1688, 651, 210, 19661, 14317, 4487, 1750, 105, 176536, 129076, 42435, 12628, 2205, 1767540, 1277159, 451626, 104755, 26775, 945, 19460671, 13974236, 5068723, 1120570, 264880, 27720
Offset: 0

Views

Author

Emeric Deutsch, Feb 26 2011

Keywords

Comments

Row n contains 1 + floor(n/2) entries.
Sum of entries in row n is n!.
T(n,0) = A186758(n).
Sum_{k>=0} k*T(n,k) = A056542(n).

Examples

			T(3,0)=2 because we have (1)(2)(3) and (132).
T(4,2)=3 because we have (13)(24), (12)(34), and (14)(23).
Triangle starts:
    1;
    1;
    1,   1;
    2,   4;
   10,  11,   3;
   59,  36,  25;
  363, 212, 130, 15;
		

Crossrefs

Programs

  • Maple
    b:= proc(n) option remember; expand(
          `if`(n=0, 1, add(b(n-i)*binomial(n-1, i-1)*
          `if`(i>1, (x+(i-1)!-1), 1), i=1..n)))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=0..degree(p)))(b(n)):
    seq(T(n), n=0..12);  # Alois P. Heinz, Mar 19 2017
  • Mathematica
    b[n_] := b[n] = Expand[If[n == 0, 1, Sum[b[n-i]*Binomial[n-1, i-1]*If[i > 1, (x + (i - 1)! - 1), 1], {i, 1, n}]]];
    T[n_] := Function[p, Table[Coefficient[p, x, i], {i, 0, Exponent[p, x]}]][ b[n]];
    Table[T[n], {n, 0, 12}] // Flatten (* Jean-François Alcover, May 03 2017, after Alois P. Heinz *)

Formula

E.g.f.: G(t,z) = exp((t-1)(exp(z)-1-z))/(1-z).
The 4-variate e.g.f. H(u,v,w,z) of the permutations of {1,2,...,n} with respect to size (marked by z), number of fixed points (marked by u), number of increasing cycles of length >=2 (marked by v), and number of nonincreasing cycles (marked by w) is given by H(u,v,w,z)=exp(uz+v(exp(z)-1-z)+w(1-exp(z))/(1-z)^w. Remark: the nonincreasing cycles are necessarily of length >=3. We have: G(t,z)=H(1,t,1,z).

A080047 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 times l has to be repeatedly decreased in step L3.

Original entry on oeis.org

0, 1, 7, 41, 256, 1807, 14477, 130321, 1303246, 14335751, 172029067, 2236377937, 31309291196, 469639368031, 7514229888601, 127741908106337, 2299354345914202, 43687732572369991, 873754651447399991
Offset: 2

Views

Author

Hugo Pfoertner, Jan 25 2003

Keywords

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

Programs

  • Mathematica
    Transpose[NestList[{First[#]+1,(First[#]+1)Last[#]+(First[#](First[#]-1))/2}&, {2,0},20]][[2]] (* Harvey P. Dale, Feb 27 2012 *)
    Rest[Rest[CoefficientList[Series[(2-Exp[x]*(x^2-2*x+2))/(2*(x-1)),{x,0,20}],x]*Range[0,20]!]] (* Vaclav Kotesovec, Oct 21 2012 *)

Formula

a(2)=0, a(n) = n*a(n-1)+(n-1)*(n-2)/2 for n>=3 c = limit n--> infinity a(n)/n! = 0.35914091422952261768 = e/2-1, a(n) = floor [c*n! - (n-1)/2] for n>=2
E.g.f.: (2-exp(x)*(x^2-2*x+2))/(2*(x-1)). - Vaclav Kotesovec, Oct 21 2012
Showing 1-10 of 17 results. Next