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 13 results. Next

A002464 Hertzsprung's problem: ways to arrange n non-attacking kings on an n X n board, with 1 in each row and column. Also number of permutations of length n without rising or falling successions.

Original entry on oeis.org

1, 1, 0, 0, 2, 14, 90, 646, 5242, 47622, 479306, 5296790, 63779034, 831283558, 11661506218, 175203184374, 2806878055610, 47767457130566, 860568917787402, 16362838542699862, 327460573946510746, 6880329406055690790, 151436547414562736234, 3484423186862152966838
Offset: 0

Views

Author

Keywords

Comments

Permutations of 12...n such that none of the following occur: 12, 23, ..., (n-1)n, 21, 32, ..., n(n-1).
This sequence is also the solution to the 'toast problem' devised by my house-mates and me as math undergraduates some 27 years ago: Given a toast rack with n slots, how many ways can the slices be removed so that no two consecutive slices are removed from adjacent slots? - David Jones (david.jones(AT)zetnet.co.uk), Oct 24 2003
This sequence was also derived by the late D. P. Robbins. - David Callan, Nov 04 2003
Another interpretation: number of permutations of n containing exactly n different patterns of size n-1. - Olivier Gérard, Nov 05 2007
Number of directed Hamiltonian paths in the complement of the n-path graph P_n. - Andrew Howroyd, Mar 16 2016
There is an obvious connection between the two descriptions of the sequence: Replace the chessboard with a n X n zero-matrix and each king with "1". This matrix will transform the vector (1,2,..,n) into a permutation such that adjacent components do not differ by 1. The reverse is also true: Any such transformation is a solution of the king problem. - Gerhard Kirchner, Feb 10 2017
A formula of Poulet (1919) relates this to A326411: a(n) = T(n+2,1)/(n+2) + 2*T(n+1,1)/(n+1) + T(n,1)/n, where T(i,j) = A326411(i,j). - N. J. A. Sloane, Mar 08 2022
For the number of these permutations without fixed points see A288208. - Wolfdieter Lang, May 22 2025

Examples

			a(4) = 2: 2413, 3142.
a(5) = 14 corresponds to these 14 permutations of length 5: 13524, 14253, 24135, 24153, 25314, 31425, 31524, 35142, 35241, 41352, 42513, 42531, 52413, 53142.
		

References

  • W. Ahrens, Mathematische Unterhaltungen und Spiele. Teubner, Leipzig, Vol. 1, 3rd ed., 1921; Vol. 2, 2nd ed., 1918. See Vol. 1, p. 271.
  • 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).
  • R. P. Stanley, Enumerative Combinatorics, Cambridge, Vol. 2, 1999; see Problem 6.40.

Crossrefs

Equals 2*A001266(n) for n >= 2. A diagonal of A001100. Cf. A010028.
Column k=1 of A333706.

Programs

  • Maple
    A002464 := proc(n) options remember; if n <= 1 then 1 elif n <= 3 then 0 else (n+1)*A002464(n-1)-(n-2)*A002464(n-2)-(n-5)*A002464(n-3)+(n-3)*A002464(n-4); fi; end;
  • Mathematica
    (* computation from the permutation class *)
    g[ L_ ] := Apply[ And, Map[ #>1&, L ] ]; f[ n_ ] := Length[ Select[ Permutations[ Range[ n ] ], g[ Rest[ Abs[ RotateRight[ # ]-# ] ] ]& ] ]; Table[ f[ n ], {n, 1, 8} ] (* Erich Friedman *)
    (* or direct computation of terms *)
    Table[n! + Sum[(-1)^r*(n-r)!*Sum[2^c *Binomial[r-1,c-1] *Binomial[n-r,c], {c,1,r}], {r,1,n-1}], {n,1,30}] (* Vaclav Kotesovec, Mar 28 2011 *)
    (* or from g.f. *)
    M = 30; CoefficientList[Sum[n!*x^n*(1-x)^n/(1+x)^n, {n, 0, M}] + O[x]^M, x] (* Jean-François Alcover, Jul 07 2015 *)
    CoefficientList[Series[Exp[(1 + x)/((-1 + x) x)] (1 + x) Gamma[0, (1 + x)/((-1 + x) x)]/((-1 + x) x), {x, 0, 20}], x] (* Eric W. Weisstein, Apr 11 2018 *)
    RecurrenceTable[{a[n] == (n + 1) a[n - 1] - (n - 2) a[n - 2] - (n - 5) a[n - 3] + (n - 3) a[n - 4], a[0] == a[1] == 1, a[2] == a[3] == 0}, a, {n, 0, 20}] (* Eric W. Weisstein, Apr 11 2018 *)
  • PARI
    N = 66;  x = 'x + O('x^N);
    gf = sum(n=0,N, n!*(x*(1-x))^n/(1+x)^n );
    v = Vec(gf) /* Joerg Arndt, Apr 17 2013 */
    
  • Python
    from math import factorial, comb
    def A002464(n): return factorial(n)+sum((-1 if k&1 else 1)*factorial(n-k)*sum(comb(k-1,t-1)*comb(n-k,t)<Chai Wah Wu, Feb 19 2024

Formula

If n = 0 or 1 then a(n) = 1; if n = 2 or 3 then a(n) = 0; otherwise a(n) = (n+1)*a(n-1) - (n-2)*a(n-2) - (n-5)*a(n-3) + (n-3)*a(n-4).
G.f.: Sum_{n >= 0} n!*x^n*(1-x)^n/(1+x)^n. - Philippe Flajolet
G.f.: e^((1 + x)/((-1 + x) * x)) * (1 + x) * Gamma(0, (1 + x)/((-1 + x) * x))/((-1 + x) * x). - Eric W. Weisstein, May 16 2014
Let S_{n, k} = number of permutations of 12...n with exactly k rising or falling successions. Let S[n](t) = Sum_{k >= 0} S_{n, k}*t^k. Then S[0] = 1; S[1] = 1; S[2] = 2*t; S[3] = 4*t+2*t^2; for n >= 4, S[n] = (n+1-t)*S[n-1] - (1-t)*(n-2+3*t)*S[n-2] - (1-t)^2*(n-5+t)*S[n-3] + (1-t)^3*(n-3)*S[n-4].
a(n) = n! + Sum_{k=1..n} (-1)^k * Sum_{t=1..k} binomial(k-1,t-1) * binomial(n-k,t) * 2^t * (n-k)!. - Max Alekseyev, Jan 29 2006
a(n) = Sum_{k=0..n} (-1)^(n-k)*k!*b(n,k), where g.f. for b(n,k) is (1-x)/(1-(1+y)*x-y*x^2), cf. A035607. - Vladeta Jovovic, Nov 24 2007
Asymptotic (M. Abramson and W. Moser, 1966): a(n)/n! ~ (1 - 2/n^2 - 10/(3*n^3) - 6/n^4 - 154/(15*n^5) - 88/(9*n^6) + 5336/(105*n^7) + 1612/(3*n^8) + 2098234/(567*n^9) + 36500686/(1575*n^10) + ... )/e^2. - Vaclav Kotesovec, Apr 19 2011, extended Dec 27 2020
Conjecture: a(n) = Sum_{k=1..n} k!*A080246(n-1, k-1) for n > 0. - John Keith, Nov 02 2020
Proof: a(n) = Sum_{k=1..n} k!*A080246(n-1, k-1) for n > 0. Since a(n) = Sum_{k=0..n-1} (-1)^k*(n-k)!*Sum_{i=0..k} binomial(n-k,i)*binomial(n-1-i,k-i) (M. Abramson and W. Moser, 1966) which is Sum_{k=1..n} (-1)^(k-1)(n-k+1)!*Sum{i=0..k-1} binomial(n-k+1,i)*binomial(n-1-i,k-1-i) = Sum_{k=1..n} (-1)^(n-k)(k!)*Sum_{i=0..n-k} binomial(k,i)*binomial(n-1-i,n-k-i) = k!*A080246(n-1, k-1) as (-1)^(n-k) = (-1)^(n+k) and binomial(n-1-i,k-1) = binomial(n-1-i,n-k-i). - Alex McGaw, Apr 13 2023
a(n+2) = (n+2)! - Sum_{j=0..n} (-1)^j*(n+1-j)!*2*A104698(n, j), for n >= 0 (Abramson and Moser, p. 1250, (III), N_0(n+2), last line, rewritten). - Wolfdieter Lang, May 14 2025

Extensions

Merged with the old A001100, Aug 19 2003
Kaplansky reference from David Callan, Oct 29 2003
Tauraso reference from Parthasarathy Nambi, Dec 21 2006
Edited by Jon E. Schoenfield, Jan 31 2015

A001100 Triangle read by rows: T(n,k) = number of permutations of length n with exactly k rising or falling successions, for n >= 1, 0 <= k <= n-1.

Original entry on oeis.org

1, 0, 2, 0, 4, 2, 2, 10, 10, 2, 14, 40, 48, 16, 2, 90, 230, 256, 120, 22, 2, 646, 1580, 1670, 888, 226, 28, 2, 5242, 12434, 12846, 7198, 2198, 366, 34, 2, 47622, 110320, 112820, 64968, 22120, 4448, 540, 40, 2, 479306, 1090270, 1108612, 650644, 236968, 54304, 7900, 748, 46, 2
Offset: 1

Views

Author

N. J. A. Sloane, Aug 19 2003

Keywords

Comments

Number of permutations of 12...n such that exactly k of the following occur: 12, 23, ..., (n-1)n, 21, 32, ..., n(n-1).

Examples

			Triangle T(n,k) begins (n >= 1, k = 0..n-1):
    1;
    0,    2;
    0,    4,    2;
    2,   10,   10,   2;
   14,   40,   48,  16,   2;
   90,  230,  256, 120,  22,  2;
  646, 1580, 1670, 888, 226, 28, 2;
  ...
		

References

  • F. N. David, M. G. Kendall and D. E. Barton, Symmetric Function and Allied Tables, Cambridge, 1966, p. 263.
  • J. Riordan, A recurrence for permutations without rising or falling successions. Ann. Math. Statist. 36 (1965), 708-710.
  • David Sankoff and Lani Haque, Power Boosts for Cluster Tests, in Comparative Genomics, Lecture Notes in Computer Science, Volume 3678/2005, Springer-Verlag.

Crossrefs

Triangle in A086856 multiplied by 2. Cf. A010028.

Programs

  • Maple
    S:= proc(n) option remember; `if`(n<4, [1, 1, 2*t, 4*t+2*t^2]
           [n+1], expand((n+1-t)*S(n-1) -(1-t)*(n-2+3*t)*S(n-2)
           -(1-t)^2*(n-5+t)*S(n-3) +(1-t)^3*(n-3)*S(n-4)))
        end:
    T:= (n, k)-> coeff(S(n), t, k):
    seq(seq(T(n, k), k=0..n-1), n=1..10);  # Alois P. Heinz, Jan 11 2013
  • Mathematica
    s[n_] := s[n] = If[n < 4, {1, 1, 2*t, 4*t + 2*t^2}[[n + 1]], Expand[(n + 1 - t)*s[n - 1] - (1 - t)*(n - 2 + 3*t)*s[n - 2] - (1 - t)^2*(n - 5 + t)*s[n - 3] + (1 - t)^3*(n - 3)* s[n - 4]]]; t[n_, k_] := Ceiling[Coefficient[s[n], t, k]]; Flatten[ Table[ Table[t[n, k], {k, 0, n - 1}], {n, 1, 10}]] (* Jean-François Alcover, Jan 25 2013, translated from Alois P. Heinz's Maple program *)

Formula

Let T{n, k} = number of permutations of 12...n with exactly k rising or falling successions. Let S[n](t) = Sum_{k >= 0} T{n, k}*t^k. Then S[0] = 1; S[1] = 1; S[2] = 2*t; S[3] = 4*t+2*t^2; for n >= 4, S[n] = (n+1-t)*S[n-1] - (1-t)*(n-2+3*t)*S[n-2] - (1-t)^2*(n-5+t)*S[n-3] + (1-t)^3*(n-3)*S[n-4].
T(n, 0) = n! + Sum_{i=1..m-1} (-1)^i*(n-i)!*Sum_{j=1..i} 2^j*binomial(i-1, j-1)*binomial(n-i, j), and T(n, k) = Sum_{i=1..m-1} (-1)^(i-k)*binomial(i, k)*(n-i)!*Sum_{j=1..i} 2^j*binomial(i-1, j-1)*binomial(n-i, j), for k >= 1, and n >= 1. See the D. P.Robbins link for A(n, k) = T(n, k), and his comment concerning the case k = i = 0 . - Wolfdieter Lang, May 17 2025

A000130 One-half the number of permutations of length n with exactly 1 rising or falling successions.

Original entry on oeis.org

0, 0, 1, 2, 5, 20, 115, 790, 6217, 55160, 545135, 5938490, 70686805, 912660508, 12702694075, 189579135710, 3019908731105, 51139445487680, 917345570926087, 17376071107513090, 346563420097249645, 7259714390232227300, 159352909727731210835, 3657569576966074846118
Offset: 0

Views

Author

Keywords

Comments

(1/2) times number of permutations of 12...n such that exactly one of the following occurs: 12, 23, ..., (n-1)n, 21, 32, ..., n(n-1).
Partial sums seem to be in A000239. - Ralf Stephan, Aug 28 2003

References

  • F. N. David, M. G. Kendall and D. E. Barton, Symmetric Function and Allied Tables, Cambridge, 1966, p. 263.
  • J. Riordan, A recurrence for permutations without rising or falling successions. Ann. Math. Statist. 36 (1965), 708-710.
  • 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

Cf. A002464, A086853. Equals A086852/2. A diagonal of A010028.

Programs

  • Maple
    S:= proc(n) option remember; `if`(n<4, [1, 1, 2*t, 4*t+2*t^2]
           [n+1], expand((n+1-t)*S(n-1) -(1-t)*(n-2+3*t)*S(n-2)
           -(1-t)^2*(n-5+t)*S(n-3) +(1-t)^3*(n-3)*S(n-4)))
        end:
    a:= n-> coeff(S(n), t, 1)/2:
    seq(a(n), n=0..30);  # Alois P. Heinz, Dec 21 2012
  • Mathematica
    S[n_] := S[n] = If[n<4, {1, 1, 2*t, 4*t+2*t^2}[[n+1]], Expand[(n+1-t)*S[n-1] - (1-t)*(n-2+3*t)*S[n-2] - (1-t)^2*(n-5+t)*S[n-3] + (1-t)^3*(n-3)*S[n-4]]]; a[n_] := Coefficient[S[n], t, 1]/2; Table[a[n], {n, 0, 30}] (* Jean-François Alcover, Mar 10 2014, after Alois P. Heinz *)

Formula

Coefficient of t^1 in S[n](t) defined in A002464, divided by 2.
a(n) ~ exp(-2) * n!. - Vaclav Kotesovec, Sep 11 2014

A000349 One-half the number of permutations of length n with exactly 2 rising or falling successions.

Original entry on oeis.org

0, 0, 0, 1, 5, 24, 128, 835, 6423, 56410, 554306, 6016077, 71426225, 920484892, 12793635300, 190730117959, 3035659077083, 51371100102990, 920989078354838, 17437084517068465, 347647092476801301, 7280060180210901232, 159755491837445900120, 3665942433747225901707
Offset: 0

Views

Author

Keywords

Comments

(1/2) times number of permutations of 12...n such that exactly 2 of the following occur: 12, 23, ..., (n-1)n, 21, 32, ..., n(n-1).

References

  • F. N. David, M. G. Kendall and D. E. Barton, Symmetric Function and Allied Tables, Cambridge, 1966, p. 263.
  • J. Riordan, A recurrence for permutations without rising or falling successions. Ann. Math. Statist. 36 (1965), 708-710.
  • 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

Cf. A002464, A000130, A086852. Equals A086853/2. A diagonal of A010028.

Programs

  • Maple
    S:= proc(n) option remember; `if`(n<4, [1, 1, 2*t, 4*t+2*t^2]
           [n+1], expand((n+1-t)*S(n-1) -(1-t)*(n-2+3*t)*S(n-2)
           -(1-t)^2*(n-5+t)*S(n-3) +(1-t)^3*(n-3)*S(n-4)))
        end:
    a:= n-> ceil(coeff(S(n), t, 2)/2):
    seq(a(n), n=0..25);  # Alois P. Heinz, Jan 11 2013
  • Mathematica
    S[n_] := S[n] = If[n<4, {1, 1, 2*t, 4*t+2*t^2}[[n+1]], Expand[(n+1-t)*S[n-1]-(1-t)*(n-2+3*t)*S[n-2]-(1-t)^2*(n-5+t)*S[n-3]+(1-t)^3*(n-3)*S[n-4]]]; a[n_] := Ceiling[Coefficient[S[n], t, 2]/2]; Table[a[n], {n, 0, 25}] (* Jean-François Alcover, Mar 11 2014, after Alois P. Heinz *)

Formula

Coefficient of t^2 in S[n](t) defined in A002464, divided by 2.
Recurrence: (n-3)*(n-2)*(n-4)^3*a(n) = (n-3)*(n^4-9*n^3+23*n^2-4*n-29)*(n-4)*a(n-1) - (n-1)*(n^4-12*n^3+57*n^2-125*n+104)*(n-4)*a(n-2) - (n-2)*(n-1)*(n^4-15*n^3+83*n^2-198*n+169)*a(n-3) + (n-3)^3*(n-2)^2*(n-1)*a(n-4). - Vaclav Kotesovec, Aug 10 2013
a(n) ~ sqrt(2*Pi)*n^(n+1/2)/exp(n+2). - Vaclav Kotesovec, Aug 10 2013

A001267 One-half the number of permutations of length n with exactly 3 rising or falling successions.

Original entry on oeis.org

0, 0, 0, 0, 1, 8, 60, 444, 3599, 32484, 325322, 3582600, 43029621, 559774736, 7841128936, 117668021988, 1883347579515, 32026067455084, 576605574327174, 10957672400252944, 219190037987444577, 4603645435776504120, 101292568208941883236, 2329975164242735146316
Offset: 0

Views

Author

Keywords

Comments

(1/2) times number of permutations of 12...n such that exactly 3 of the following occur: 12, 23, ..., (n-1)n, 21, 32, ..., n(n-1).

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

Cf. A002464, A000130, A086852. Equals A086854/2. A diagonal of A010028.

Programs

  • Maple
    S:= proc(n) option remember; `if`(n<4, [1, 1, 2*t, 4*t+2*t^2]
           [n+1], expand((n+1-t)*S(n-1) -(1-t)*(n-2+3*t)*S(n-2)
           -(1-t)^2*(n-5+t)*S(n-3) +(1-t)^3*(n-3)*S(n-4)))
        end:
    a:= n-> coeff(S(n), t, 3)/2:
    seq(a(n), n=0..25);  # Alois P. Heinz, Jan 11 2013
  • Mathematica
    S[n_] := S[n] = If[n<4, {1, 1, 2*t, 4*t+2*t^2}[[n+1]], Expand[(n+1-t)*S[n-1] - (1-t)*(n-2+3*t)*S[n-2] - (1-t)^2*(n-5+t)*S[n-3] + (1-t)^3*(n-3)*S[n-4]]]; a[n_] := Coefficient[S[n], t, 3]/2; Table[a[n], {n, 0, 25}] (* Jean-François Alcover, Mar 11 2014, after Alois P. Heinz *)

Formula

Coefficient of t^3 in S[n](t) defined in A002464, divided by 2.
a(n) ~ 2/(3*exp(2)) * n!. - Vaclav Kotesovec, Aug 10 2013
Recurrence: (n-4)*(2*n^6 - 52*n^5 + 557*n^4 - 3136*n^3 + 9740*n^2 - 15727*n + 10242)*a(n) = + (n-4)*(2*n^7 - 50*n^6 + 511*n^5 - 2693*n^4 + 7450*n^3 - 9041*n^2 - 157*n + 6666)*a(n-1) - (2*n^8 - 58*n^7 + 735*n^6 - 5289*n^5 + 23430*n^4 - 64575*n^3 + 106105*n^2 - 92312*n + 30900)*a(n-2) - (2*n^7 - 54*n^6 + 615*n^5 - 3795*n^4 + 13554*n^3 - 27681*n^2 + 29473*n - 12330)*(n-2)*a(n-3) + (2*n^6 - 40*n^5 + 327*n^4 - 1388*n^3 + 3184*n^2 - 3675*n + 1626)*(n-2)^2*a(n-4). - Vaclav Kotesovec, Aug 10 2013

A086853 Number of permutations of length n with exactly 2 rising or falling successions.

Original entry on oeis.org

0, 0, 0, 2, 10, 48, 256, 1670, 12846, 112820, 1108612, 12032154, 142852450, 1840969784, 25587270600, 381460235918, 6071318154166, 102742200205980, 1841978156709676, 34874169034136930, 695294184953602602, 14560120360421802464, 319510983674891800240
Offset: 0

Views

Author

N. J. A. Sloane, Aug 19 2003

Keywords

Comments

Permutations of 12...n such that exactly 2 of the following occur: 12, 23, ..., (n-1)n, 21, 32, ..., n(n-1).

References

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

Crossrefs

Programs

  • Maple
    S:= proc(n) option remember; `if`(n<4, [1, 1, 2*t, 4*t+2*t^2]
           [n+1], expand((n+1-t)*S(n-1) -(1-t)*(n-2+3*t)*S(n-2)
           -(1-t)^2*(n-5+t)*S(n-3) +(1-t)^3*(n-3)*S(n-4)))
        end:
    a:= n-> ceil(coeff(S(n), t, 2)):
    seq(a(n), n=0..25);  # Alois P. Heinz, Jan 11 2013
  • Mathematica
    s[n_] := s[n] = If[n<4, {1, 1, 2*t, 4*t+2*t^2}[[n+1]], Expand[(n+1-t)*s[n-1] - (1-t)*(n-2+3*t)*s[n-2] - (1-t)^2*(n-5+t)*s[n-3] + (1-t)^3*(n-3)*s[n-4]]]; t[n_, k_] := Ceiling[Coefficient[s[n], t, k]]; a[n_] := t[n, 2]; Table[a[n], {n, 0, 22}] (* Jean-François Alcover, Mar 11 2014, after Alois P. Heinz *)

Formula

Coefficient of t^2 in S[n](t) defined in A002464.
Conjecture: (-514*n+2465)*a(n) +2*(257*n^2-955*n-1085)*a(n-1) +(-555*n^2+2483*n-1670)*a(n-2) +16*(-17*n^2+73*n-75)*a(n-3) +(354*n^2+528*n-2299)*a(n-4) +2*(-121*n^2+1045*n-1401)*a(n-5) +3*(67*n-115)*(n-4)*a(n-6)=0. - R. J. Mathar, Jun 06 2013
shorter recurrence: (n-3)*(n-2)*(n-4)^3*a(n) = (n-3)*(n^4-9*n^3+23*n^2-4*n-29)*(n-4)*a(n-1) - (n-1)*(n^4-12*n^3+57*n^2-125*n+104)*(n-4)*a(n-2) - (n-2)*(n-1)*(n^4-15*n^3+83*n^2-198*n+169)*a(n-3) + (n-3)^3*(n-2)^2*(n-1)*a(n-4). - Vaclav Kotesovec, Aug 10 2013
a(n) ~ 2*exp(-2) * n!. - Vaclav Kotesovec, Aug 10 2013

A086854 Number of permutations of length n with exactly 3 rising or falling successions.

Original entry on oeis.org

0, 0, 0, 0, 2, 16, 120, 888, 7198, 64968, 650644, 7165200, 86059242, 1119549472, 15682257872, 235336043976, 3766695159030, 64052134910168, 1153211148654348, 21915344800505888, 438380075974889154, 9207290871553008240, 202585136417883766472, 4659950328485470292632
Offset: 0

Views

Author

N. J. A. Sloane, Aug 19 2003

Keywords

Comments

Permutations of 12...n such that exactly 3 of the following occur: 12, 23, ..., (n-1)n, 21, 32, ..., n(n-1).

References

  • F. N. David, M. G. Kendall and D. E. Barton, Symmetric Function and Allied Tables, Cambridge, 1966, p. 263.
  • J. Riordan, A recurrence for permutations without rising or falling successions. Ann. Math. Statist. 36 (1965), 708-710.

Crossrefs

Programs

  • Maple
    S:= proc(n) option remember; `if`(n<4, [1, 1, 2*t, 4*t+2*t^2]
           [n+1], expand((n+1-t)*S(n-1) -(1-t)*(n-2+3*t)*S(n-2)
           -(1-t)^2*(n-5+t)*S(n-3) +(1-t)^3*(n-3)*S(n-4)))
        end:
    a:= n-> coeff(S(n), t, 3):
    seq(a(n), n=0..25);  # Alois P. Heinz, Jan 11 2013
  • Mathematica
    S[n_] := S[n] = If[n < 4, {1, 1, 2*t, 4*t+2*t^2}[[n+1]], Expand[(n+1-t)*S[n-1] - (1-t)*(n-2+3*t)*S[n-2] - (1-t)^2*(n-5+t)*S[n-3] + (1-t)^3*(n-3)*S[n-4]]]; a[n_] := Coefficient[S[n], t, 3]; Table[a[n], {n, 0, 25}] (* Jean-François Alcover, Apr 09 2014, after Alois P. Heinz *)

Formula

Coefficient of t^3 in S[n](t) defined in A002464.
Recurrence (for n>4): (n-4)*(2*n^6 - 52*n^5 + 557*n^4 - 3136*n^3 + 9740*n^2 - 15727*n + 10242)*a(n) = (n-4)*(2*n^7 - 50*n^6 + 511*n^5 - 2693*n^4 + 7450*n^3 - 9041*n^2 - 157*n + 6666)*a(n-1) - (2*n^8 - 58*n^7 + 735*n^6 - 5289*n^5 + 23430*n^4 - 64575*n^3 + 106105*n^2 - 92312*n + 30900)*a(n-2) - (2*n^7 - 54*n^6 + 615*n^5 - 3795*n^4 + 13554*n^3 - 27681*n^2 + 29473*n - 12330)*(n-2)*a(n-3) + (2*n^6 - 40*n^5 + 327*n^4 - 1388*n^3 + 3184*n^2 - 3675*n + 1626)*(n-2)^2*a(n-4). - Vaclav Kotesovec, Aug 11 2013
a(n) ~ 4/3*exp(-2) * n! = n! * 0.45231366335478... - Vaclav Kotesovec, Aug 11 2013

A001268 One-half the number of permutations of length n with exactly 4 rising or falling successions.

Original entry on oeis.org

0, 0, 0, 0, 0, 1, 11, 113, 1099, 11060, 118484, 1366134, 16970322, 226574211, 3240161105, 49453685911, 802790789101, 13815657556958, 251309386257874, 4818622686395380, 97145520138758844, 2054507019515346789, 45484006970415223287, 1052036480881734378541
Offset: 0

Views

Author

Keywords

Comments

(1/2) times number of permutations of 12...n such that exactly 4 of the following occur: 12, 23, ..., (n-1)n, 21, 32, ..., n(n-1).

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

Cf. A002464, A000130, A086852. Equals A086855/2. A diagonal of A010028.

Programs

  • Maple
    S:= proc(n) option remember; `if`(n<4, [1, 1, 2*t, 4*t+2*t^2]
           [n+1], expand((n+1-t)*S(n-1) -(1-t)*(n-2+3*t)*S(n-2)
           -(1-t)^2*(n-5+t)*S(n-3) +(1-t)^3*(n-3)*S(n-4)))
        end:
    a:= n-> ceil(coeff(S(n), t, 4)/2):
    seq(a(n), n=0..25);  # Alois P. Heinz, Jan 11 2013
  • Mathematica
    S[n_] := S[n] = If[n<4, {1, 1, 2*t, 4*t + 2*t^2}[[n+1]], Expand[(n+1-t)*S[n-1] - (1-t)*(n-2+3*t)*S[n-2] - (1-t)^2*(n-5+t)*S[n-3] + (1-t)^3*(n-3)*S[n-4]]]; a[n_] := Ceiling[Coefficient[S[n], t, 4]/2]; Table [a[n], {n, 0, 25}] (* Jean-François Alcover, Mar 24 2014, after Alois P. Heinz *)

Formula

Coefficient of t^4 in S[n](t) defined in A002464, divided by 2.
Recurrence (for n>5): (n-5)*(n^8 - 41*n^7 + 730*n^6 - 7358*n^5 + 45799*n^4 - 179702*n^3 + 432498*n^2 - 581244*n + 332100)*a(n) = (n^10 - 45*n^9 + 895*n^8 - 10301*n^7 + 75340*n^6 - 361190*n^5 + 1124682*n^4 - 2150033*n^3 + 2147364*n^2 - 499899*n - 544266)*a(n-1) - (n^10 - 44*n^9 + 869*n^8 - 10112*n^7 + 76390*n^6 - 388742*n^5 + 1336932*n^4 - 3028095*n^3 + 4237931*n^2 - 3198426*n + 917988)*a(n-2) - (n^10 - 43*n^9 + 823*n^8 - 9195*n^7 + 66108*n^6 - 318138*n^5 + 1033118*n^4 - 2224673*n^3 + 3023402*n^2 - 2325285*n + 761190)*a(n-3) + (n^8 - 33*n^7 + 471*n^6 - 3783*n^5 + 18594*n^4 - 56865*n^3 + 104723*n^2 - 104847*n + 42783)*(n-2)^2*a(n-4). - Vaclav Kotesovec, Aug 11 2013
a(n) ~ n!*exp(-2)/3. - Vaclav Kotesovec, Aug 11 2013

A086855 Number of permutations of length n with exactly 4 rising or falling successions.

Original entry on oeis.org

0, 0, 0, 0, 0, 2, 22, 226, 2198, 22120, 236968, 2732268, 33940644, 453148422, 6480322210, 98907371822, 1605581578202, 27631315113916, 502618772515748, 9637245372790760, 194291040277517688, 4109014039030693578, 90968013940830446574, 2104072961763468757082
Offset: 0

Views

Author

N. J. A. Sloane, Aug 19 2003

Keywords

Comments

Permutations of 12...n such that exactly 4 of the following occur: 12, 23, ..., (n-1)n, 21, 32, ..., n(n-1).

References

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

Crossrefs

Twice A001268.

Programs

  • Maple
    S:= proc(n) option remember; `if`(n<4, [1, 1, 2*t, 4*t+2*t^2]
           [n+1], expand((n+1-t)*S(n-1) -(1-t)*(n-2+3*t)*S(n-2)
           -(1-t)^2*(n-5+t)*S(n-3) +(1-t)^3*(n-3)*S(n-4)))
        end:
    a:= n-> ceil(coeff(S(n), t, 4)):
    seq(a(n), n=0..25);  # Alois P. Heinz, Jan 11 2013
  • Mathematica
    S[n_] := S[n] = If[n<4, {1, 1, 2*t, 4*t+2*t^2}[[n+1]], Expand[(n+1-t)*S[n-1] - (1-t)*(n-2+3*t)*S[n-2] - (1-t)^2*(n-5+t)*S[n-3] + (1-t)^3*(n-3)*S[n-4]]]; a[n_] := Ceiling[Coefficient[S[n], t, 4]]; Table [a[n], {n, 0, 25}] (* Jean-François Alcover, Oct 13 2014, after Alois P. Heinz *)

Formula

Coefficient of t^4 in S[n](t) defined in A002464.
a(n) ~ 2/3*exp(-2) * n!. - Vaclav Kotesovec, Aug 14 2013

A383857 Number of permutations of [n] such that precisely one rising or falling succession occurs, but without either n(n-1) or (n-1)n.

Original entry on oeis.org

0, 0, 2, 8, 34, 196, 1366, 10928, 98330, 983036, 10811134, 129714184, 1686103522, 23603603540, 354033474374, 5664286296416, 96289603698346, 1733166940314028, 32929480177913230, 658578501071986616, 13829959293448920434, 304255691156335505924
Offset: 1

Views

Author

Wolfdieter Lang, May 19 2025

Keywords

Comments

See A086852 or 2*A000130 for the counting including the successions n(n-1) and (n-1)n. See also the k = 1 columns of the triangles A001100 and 2*A086856.
For the number of permutations of length n without rising or falling successions see A002464(n).

Examples

			a(3) = 2*1 from the permutations 213 and the reverted 312.
a(4) = 2*4 from 1324, 1423, 2314, 3124 and the reverted 4231, 3241, 4132, 4213.
a(5) = 2*17 from the permutations corresponding to A086852(5) = 2*20, without 13542, 24513, 25413, and the reverted 24531, 31542, 31452.
		

Crossrefs

Formula

a(n) = A002464(n+1) - (n-1) * A002464(n).
Showing 1-10 of 13 results. Next