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-4 of 4 results.

A010027 Triangle read by rows: T(n,k) is the number of permutations of [n] having k consecutive ascending pairs (0 <= k <= n-1).

Original entry on oeis.org

1, 1, 1, 1, 2, 3, 1, 3, 9, 11, 1, 4, 18, 44, 53, 1, 5, 30, 110, 265, 309, 1, 6, 45, 220, 795, 1854, 2119, 1, 7, 63, 385, 1855, 6489, 14833, 16687, 1, 8, 84, 616, 3710, 17304, 59332, 133496, 148329, 1, 9, 108, 924, 6678, 38934, 177996, 600732, 1334961, 1468457, 1
Offset: 1

Views

Author

Keywords

Comments

A "consecutive ascending pair" in a permutation p_1, p_2, ..., p_n is a pair p_i, p_{i+1} = p_i + 1.
From Emeric Deutsch, May 15 2010: (Start)
The same triangle, but with rows indexed differently, also arises as follows: U(n,k) = number of permutations of [n] having k blocks (1 <= k <= n), where a block of a permutation is a maximal sequence of consecutive integers which appear in consecutive positions. For example, the permutation 5412367 has 4 blocks: 5, 4, 123, and 67.
When seen as coefficients of polynomials with decreasing exponents: evaluations are A001339 (x=2), A081923 (x=3), A081924 (x=4), A087981 (x=-1).
The sum of the entries in row n is n!.
U(n,n) = A000255(n-1) = d(n-1) + d(n), U(n,n-1)=d(n), where d(j)=A000166(j) (derangement numbers). (End)
This is essentially the reversal of the exponential Riordan array [exp(-x)/(1-x)^2,x] (cf. A123513). - Paul Barry, Jun 17 2010
U(n-1, k-2) * n*(n-1)/k = number of permutations of [n] with k elements not fixed by the permutation. - Michael Somos, Aug 19 2018

Examples

			Triangle starts:
  1;
  1, 1;
  1, 2,   3;
  1, 3,   9,  11;
  1, 4,  18,  44,   53;
  1, 5,  30, 110,  265,   309;
  1, 6,  45, 220,  795,  1854,   2119;
  1, 7,  63, 385, 1855,  6489,  14833,  16687;
  1, 8,  84, 616, 3710, 17304,  59332, 133496,  148329;
  1, 9, 108, 924, 6678, 38934, 177996, 600732, 1334961, 1468457;
  ...
For n=3, the permutations 123, 132, 213, 231, 312, 321 have respectively 2,0,0,1,1,0 consecutive ascending pairs, so row 3 of the triangle is 3,2,1. - _N. J. A. Sloane_, Apr 12 2014
In the alternative definition, T(4,2)=3 because we have 234.1, 4.123, and 34.12 (the blocks are separated by dots). - _Emeric Deutsch_, May 16 2010
		

References

  • F. N. David, M. G. Kendall and D. E. Barton, Symmetric Function and Allied Tables, Cambridge, 1966, p. 263.

Crossrefs

Diagonals, reading from the right-hand edge: A000255, A000166, A000274, A000313, A001260, A001261. A045943 is another diagonal.
Cf. A123513 (mirror image).
A289632 is the analogous triangle with the additional restriction that all consecutive pairs must be isolated, i.e., must not be back-to-back to form longer consecutive sequences.

Programs

  • Maple
    U := proc (n, k) options operator, arrow: factorial(k+1)*binomial(n, k)*(sum((-1)^i/factorial(i), i = 0 .. k+1))/n end proc: for n to 10 do seq(U(n, k), k = 1 .. n) end do; # yields sequence in triangular form; # Emeric Deutsch, May 15 2010
  • Mathematica
    t[n_, k_] := Binomial[n, k]*Subfactorial[k+1]/n; Table[t[n, k], {n, 1, 12}, {k, 1, n}] // Flatten (* Jean-François Alcover, Jan 07 2014, after Emeric Deutsch *)
    T[0,0]:=0; T[1,1]:=1; T[n_,n_]:=T[n,n]=(n-1)T[n-1,n-1]+(n-2)T[n-2,n-2]; T[n_,k_]:=T[n,k]=T[n-1,k] (n-1)/(n-k); Flatten@Table[T[n,k],{n,1,10},{k,1,n}] (* Oliver Seipel, Dec 01 2024 *)

Formula

E.g.f.: exp(x*(y-1))/(1-x)^2. - Vladeta Jovovic, Jan 03 2003
From Emeric Deutsch, May 15 2010: (Start)
U(n,k) = binomial(n-1,k-1)*(k-1)!*Sum_{j=0..k-1} (-1)^(k-j-1)*(j+1)/(k-j-1)! (1 <= k <= n).
U(n,k) = (k+1)!*binomial(n,k)*(1/n)*Sum_{i=0..k+1} (-1)^i/i!.
U(n,k) = (1/n)*binomial(n,k)*d(k+1), where d(j)=A000166(j) (derangement numbers). (End)

Extensions

More terms from Vladeta Jovovic, Jan 03 2003
Original definition from David, Kendall and Barton restored by N. J. A. Sloane, Apr 12 2014

A000274 Number of permutations of length n with 2 consecutive ascending pairs.

Original entry on oeis.org

0, 0, 1, 3, 18, 110, 795, 6489, 59332, 600732, 6674805, 80765135, 1057289046, 14890154058, 224497707343, 3607998868005, 61576514013960, 1112225784377144, 21197714949305577, 425131949816628507, 8950146311929021210, 197350726178034917670, 4548464355722328578691
Offset: 1

Views

Author

Keywords

Comments

From Emeric Deutsch, May 25 2009: (Start)
a(n) = number of excedances in all derangements of [n-1]. Example: a(5)=18 because the derangements of {1,2,3,4} are 4*123, 3*14*2, 3*4*12, 4*3*12, 2*14*3, 2*4*13, 2*3*4*1, 3*4*21, 4*3*21 with the 18 excedances marked. An excedance of a permutation p is a position i such that p(i)>i.
a(n) = Sum(k*A046739(n,k), k>=1).
(End)
Appears to be the inverse binomial transform of A001286 (filling the two leading zeros in there), then shifting one place to the right. - R. J. Mathar, Apr 04 2012

References

  • F. N. David, M. G. Kendall and D. E. Barton, Symmetric Function and Allied Tables, Cambridge, 1966, p. 263.
  • J. Riordan, An Introduction to Combinatorial Analysis, Wiley, 1958, p. 210 (divided by 2).
  • 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

A diagonal in triangle A010027.
Cf. A046739. [Emeric Deutsch, May 25 2009]

Programs

  • Maple
    a:= n->sum((n-1)!*sum((-1)^k/k!/2, j=1..n-1), k=0..n-1): seq(a(n), n=1..23); # Zerinvary Lajos, May 17 2007
  • Mathematica
    Table[Subfactorial[n]*n/2, {n, 2, 20}] (* Zerinvary Lajos, Jul 09 2009 *)

Formula

a(n) = (1 + n) a(n - 1) + (3 + n) a(n - 2) + (3 - n) a(n - 3) + (2 - n) a(n - 4).
E.g.f.: x^2/2*exp(-x)/(1-x)^2. - Vladeta Jovovic, Jan 03 2003
a(n) = (n-1)^2/(n-2)*a(n-1)-(-1)^n*(n-1)/2, n>2, a(2)=0. - Vladeta Jovovic, Aug 31 2003
a(n) = (1/2){[n!/e] - [(n-1)!/e]} (conjectured).
a(n) = (n-1)*GAMMA(n,-1)*exp(-1)/2 where GAMMA = incomplete Gamma function. [Mark van Hoeij, Nov 11 2009]
a(n) = A145887(n-1) + A145886(n-1). - Anton Zakharov, Aug 28 2016

Extensions

Name clarified and offset changed by N. J. A. Sloane, Apr 12 2014

A000313 Number of permutations of length n with 3 consecutive ascending pairs.

Original entry on oeis.org

0, 0, 0, 1, 4, 30, 220, 1855, 17304, 177996, 2002440, 24474285, 323060540, 4581585866, 69487385604, 1122488536715, 19242660629360, 348933579412440, 6673354706262864, 134252194678935321, 2834212998777523380, 62651024183503148470, 1447238658638922729580
Offset: 1

Views

Author

Keywords

Comments

Temporary remark: there may be some issues with respect to the offset of this sequence in the formula and program sections. - Joerg Arndt, Nov 16 2014

References

  • F. N. David, M. G. Kendall and D. E. Barton, Symmetric Function and Allied Tables, Cambridge, 1966, p. 263.
  • 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

A diagonal in triangle A010027.

Programs

  • Maple
    series(hypergeom([2,4],[],x/(x+1))/(x+1)^4, x=0, 30); # Mark van Hoeij, Nov 07 2011
    a := n -> simplify(hypergeom([4-n,2],[],1))*(-1)^n*(n-1)*(n-2)*(n-3)/6: seq(a(n), n=1..23); # Peter Luschny, Nov 19 2014
  • Mathematica
    Table[(n*(n + 1)!/6)*Sum[(-1)^k/k!, {k, 0, n}], {n, -1, 25}] (* T. D. Noe, Jun 19 2012 *)
    a[1]:=0; a[n_Integer/;n>=2]:=(n-2) (n-1) Subfactorial[n-2]/6 (* Todd Silvestri, Nov 15 2014 *)
  • Sage
    a = lambda n: (n-2)*(n-1)*sloane.A000166(n-2)/6 if n>2 else 0
    [a(n) for n in range(1,24)] # Peter Luschny, Nov 19 2014

Formula

a(n) = (n*(n+1)!/6)*sum((-1)^k/k!, k=0..n).
a(n) = A065087(n+2)/3. - Zerinvary Lajos, May 25 2007
E.g.f.: x^3/3!*exp(-x)/(1-x)^2. - Vladeta Jovovic, Jan 03 2003
a(n) = round( (exp(-1)*(n+1)!+(-1)^n)*n/6 ). - Mark van Hoeij, Oct 25 2011
G.f.: hypergeom([2, 4],[],x/(x+1))/(x+1)^4. - Mark van Hoeij, Nov 07 2011
a(1) = 0, a(n) = (n-2)*(n-1)*(!(n-2))/6 = (n-2)*(n-1)*A000166(n-2)/6, for n >= 2. - Todd Silvestri, Nov 15 2014
a(n) = hypergeom([4-n,2],[],1)*(-1)^n*A000292(n-3). - Peter Luschny, Nov 19 2014
D-finite with recurrence (-n+4)*a(n) +(n-1)*(n-4)*a(n-1) +(n-1)*(n-2)*a(n-2)=0. - R. J. Mathar, Aug 01 2022

Extensions

More terms from Vladeta Jovovic, Jan 03 2003
Formula added by Sean A. Irvine, Nov 11 2010
Name clarified and offset changed by N. J. A. Sloane, Apr 12 2014

A001260 Number of permutations of length n with 4 consecutive ascending pairs.

Original entry on oeis.org

0, 0, 0, 0, 1, 5, 45, 385, 3710, 38934, 444990, 5506710, 73422855, 1049946755, 16035550531, 260577696015, 4489954146860, 81781307674780, 1570201107355980, 31698434854748604, 671260973394676605, 14879618243581997745
Offset: 1

Views

Author

Keywords

References

  • F. N. David, M. G. Kendall and D. E. Barton, Symmetric Function and Allied Tables, Cambridge, 1966, p. 263.
  • 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

A diagonal in triangle A010027.

Programs

  • Maple
    a:=n->sum((n+2)!*sum((-1)^k/k!/4!, j=1..n), k=0..n): seq(a(n), n=2..19); # Zerinvary Lajos, May 25 2007
    series(hypergeom([2, 5],[],x/(x+1))/(x+1)^5,x=0,30); # Mark van Hoeij, Nov 07 2011
  • Mathematica
    Drop[CoefficientList[Series[x^4/4! Exp[-x]/(1 - x)^2, {x, 0, 20}], x] Range[0, 20]!, 4] (* Vaclav Kotesovec, Mar 26 2014 *)

Formula

(n-1)*a(n) = (n+3)*(a(n-1)*n + a(n-2)*n - a(n-1) + 2*a(n-2)).
E.g.f.: (for offset 4): (x^4/4!)*exp(-x)/(1-x)^2. - Vladeta Jovovic, Jan 03 2003
G.f.: (for offset 0): hypergeom([2, 5],[],x/(x+1))/(x+1)^5. - Mark van Hoeij, Nov 07 2011
Recurrence (for offset 5): (n-5)*a(n) = (n-5)*(n-1)*a(n-1) + (n-2)*(n-1)*a(n-2). - Vaclav Kotesovec, Mar 26 2014
a(n) ~ n! * exp(-1)/24. - Vaclav Kotesovec, Mar 26 2014

Extensions

More terms from Vladeta Jovovic, Jan 03 2003
Name clarified and offset changed by N. J. A. Sloane, Apr 12 2014
Showing 1-4 of 4 results.