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
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.
- 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.
- N. J. A. Sloane, Table of n, a(n) for n = 0..500
- M. Abramson and W. O. J. Moser, Permutations without rising or falling w-sequences, Ann. Math. Stat., 38 (1967), 1245-1254.
- W. Ahrens, Mathematische Unterhaltungen und Spiele, Leipzig: B. G. Teubner, 1901.
- Another Roof, A Lifelong Mathematical Obsession, YouTube video, 2023.
- Art of Problem Solving Forum, Number of permutative
- Eli Bagno, Estrella Eisenberg, Shulamit Reches, and Moriah Sigron, On the poset of King-Non-Attacking permutations, arXiv:1905.02387 [math.CO], 2019.
- Eli Bagno, Estrella Eisenberg, Shulamit Reches, and Moriah Sigron, Counting King Permutations on the Cylinder, arXiv:2001.02948 [math.CO], 2020.
- Christoph Bärligea, On the dimension of the Fomin-Kirillov algebra and related algebras, arXiv:2001.04597 [math.QA], 2020.
- Robert Brignall, Vít Jelínek, Jan Kynčl, and David Marchant, Zeros of the Möbius function of permutations, arXiv:1810.05449 [math.CO], 2018.
- Doug Chatham, Independence and domination on shogiboard graphs, Recreational Mathematics Magazine 4.8 (2017), pp. 25-37.
- Doug Chatham, Reflections on the n+k dragon kings problem, Games and Puzzles, Recreational Mathematics Magazine (2018) 5.10, 39-55.
- Anders Claesson, From Hertzsprung's problem to pattern-rewriting systems, University of Iceland (2020).
- P. Flajolet and R. Sedgewick, Analytic Combinatorics, 2009; see page 373.
- Sela Fried, Further results on staircase (cyclic) words, arXiv:2501.11991 [math.CO], 2025. See p. 12.
- Sela Fried, Toufik Mansour, and Mark Shattuck, Counting k-ary words by number of adjacency differences of a prescribed size, arXiv:2504.03013 [math.CO], 2025. See p. 2.
- Michael Han, Tanya Khovanova, Ella Kim, Evin Liang, Miriam Lubashev, Oleg Polin, Vaibhav Rastogi, Benjamin Taycher, Ada Tsui and Cindy Wei, Fun with Latin Squares, arXiv:2109.01530 [math.HO], 2021.
- C. Homberger, Counting Fixed Length Permutation Patterns, Online Journal of Analytic Combinatorics, 7 (2012).
- Cheyne Homberger, Patterns in Permutations and Involutions: A Structural and Enumerative Approach, arXiv preprint 1410.2657 [math.CO], 2014.
- Mark Huibregtse, Cristobal Lemus-Vidales, and David Vella, Bootstrap Percolation, Indecomposable Permutations, and the n-Kings problem, arXiv:2508.02030 [math.CO], 2025. See p. 2.
- Irving Kaplansky, The asymptotic distribution of runs of consecutive elements, Ann. Math. Statistics, 16 (1945), 200-203
- Sergey Kitaev and Jeffrey Remmel, (a,b)-rectangle patterns in permutations and words, arXiv:1304.4286 [math.CO], (2013).
- Vaclav Kotesovec, Non-attacking chess pieces, 6ed, 2013, pp. 625-635.
- Igor Minevich, Gabe Cunningham, Aditya Karan, and Joshua V. Gyllinsky, Parks: A Doubly Infinite Family of NP-Complete Puzzles and Generalizations of A002464, arXiv:2411.02251 [cs.CC], 2024.
- O. Patashnik and P. Flajolet, Email to N. J. A. Sloane, Nov 26 1989
- P. Poulet, Query 4750: Permutations, L'Intermédiaire des Mathématiciens, 26 (1919), 117-121. (Page 117)
- P. Poulet, Query 4750: Permutations, L'Intermédiaire des Mathématiciens, 26 (1919), 117-121. (Pages 118, 119)
- P. Poulet, Query 4750: Permutations, L'Intermédiaire des Mathématiciens, 26 (1919), 117-121. (Pages 120, 121)
- J. Riordan, A recurrence for permutations without rising or falling successions, Ann. Math. Statist. 36 (1965), 708-710.
- D. P. Robbins, The probability that neighbors remain neighbors after random rearrangements, Amer. Math. Monthly 87 (1980), 122-124.
- Josef Rukavicka, Secretary problem and two almost the same consecutive applicants, arXiv:2106.11244 [math.PR], 2021.
- A. J. Schwenk, Letter to N. J. A. Sloane, Mar 24 1980 (with enclosure and notes)
- L. Shapiro and A. B. Stephens, Bootstrap percolation, the Schroeder problems and the n-kings problem, SIAM J. Discrete Math., 4 (1991), 275-280.
- Jason P. Smith, A Formula for the Mobius function of the Permutation Poset Based on a Topological Decomposition, arXiv preprint arXiv:1506.04406 [math.CO], 2015.
- Roberto Tauraso, The Dinner Table Problem: The Rectangular Case, INTEGERS: Electronic Journal of Combinatorial Number Theory, Vol. 6 (2006), #A11. See Column 3 in the table on page 3.
- B. E. Tenner, Mesh patterns with superfluous mesh, arXiv preprint arXiv:1302.1883 [math.CO], 2013.
- Eric Weisstein's World of Mathematics, Hamiltonian Path
- Eric Weisstein's World of Mathematics, Path Complement Graph
- Eric Weisstein's World of Mathematics, Permutation
-
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;
-
(* 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 *)
-
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 */
-
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
Merged with the old
A001100, Aug 19 2003
A086852
Number of permutations of length n with exactly 1 rising or falling succession.
Original entry on oeis.org
0, 0, 2, 4, 10, 40, 230, 1580, 12434, 110320, 1090270, 11876980, 141373610, 1825321016, 25405388150, 379158271420, 6039817462210, 102278890975360, 1834691141852174, 34752142215026180, 693126840194499290, 14519428780464454600, 318705819455462421670
Offset: 0
- F. N. David, M. G. Kendall and D. E. Barton, Symmetric Function and Allied Tables, Cambridge, 1966, p. 263.
- Alois P. Heinz, Table of n, a(n) for n = 0..200
- Sergey Kitaev, Jeffrey Remmel, (a,b)-rectangle patterns in permutations and words, arXiv:1304.4286 [math.CO], 2013.
- J. Riordan, A recurrence for permutations without rising or falling successions, Ann. Math. Statist. 36 (1965), 708-710.
- D. P. Robbins, The probability that neighbors remain neighbors after random rearrangements, Amer. Math. Monthly 87 (1980), 122-124.
-
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):
seq(a(n), n=0..30); # Alois P. Heinz, Dec 21 2012
-
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]; Table[a[n], {n, 0, 30}] (* Jean-François Alcover, Mar 11 2014, after Alois P. Heinz *)
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
- 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).
-
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
-
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 *)
A010028
Triangle read by rows: T(n,k) is one-half the number of permutations of length n with exactly n-k rising or falling successions, for n >= 1, 1 <= k <= n. T(1,1) = 1 by convention.
Original entry on oeis.org
1, 1, 0, 1, 2, 0, 1, 5, 5, 1, 1, 8, 24, 20, 7, 1, 11, 60, 128, 115, 45, 1, 14, 113, 444, 835, 790, 323, 1, 17, 183, 1099, 3599, 6423, 6217, 2621, 1, 20, 270, 2224, 11060, 32484, 56410, 55160, 23811, 1, 23, 374, 3950, 27152, 118484, 325322, 554306, 545135, 239653
Offset: 1
Triangle T(n,k) begins:
1;
1, 0;
1, 2, 0;
1, 5, 5, 1;
1, 8, 24, 20, 7;
1, 11, 60, 128, 115, 45;
1, 14, 113, 444, 835, 790, 323;
1, 17, 183, 1099, 3599, 6423, 6217, 2621;
...
- F. N. David, M. G. Kendall and D. E. Barton, Symmetric Function and Allied Tables, Cambridge, 1966, p. 263.
-
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)-> ceil(coeff(S(n), t, n-k)/2):
seq(seq(T(n, k), k=1..n), n=1..12); # Alois P. Heinz, Dec 21 2012
-
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, n-k]/2]; Table[Table[T[n, k], {k, 1, n}], {n, 1, 12}] // Flatten (* Jean-François Alcover, Jan 14 2014, translated from Alois P. Heinz's Maple code *)
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
- 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).
-
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
-
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 *)
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
- F. N. David, M. G. Kendall and D. E. Barton, Symmetric Function and Allied Tables, Cambridge, 1966, p. 263.
-
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
-
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 *)
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
- 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.
-
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
-
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 *)
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
- 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).
-
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
-
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 *)
A086856
Triangle read by rows: T(n,k) = one-half number of permutations of length n with exactly k rising or falling successions, for n >= 1, 0 <= k <= n-1. T(1,0) = 1 by convention.
Original entry on oeis.org
1, 0, 1, 0, 2, 1, 1, 5, 5, 1, 7, 20, 24, 8, 1, 45, 115, 128, 60, 11, 1, 323, 790, 835, 444, 113, 14, 1, 2621, 6217, 6423, 3599, 1099, 183, 17, 1, 23811, 55160, 56410, 32484, 11060, 2224, 270, 20, 1, 239653, 545135, 554306, 325322, 118484, 27152, 3950, 374, 23, 1, 2648395
Offset: 1
Triangle T(n,k) begins:
1;
0, 1;
0, 2, 1;
1, 5, 5, 1;
7, 20, 24, 8, 1;
45, 115, 128, 60, 11, 1;
323, 790, 835, 444, 113, 14, 1;
...
- F. N. David, M. G. Kendall and D. E. Barton, Symmetric Function and Allied Tables, Cambridge, 1966, p. 263.
Triangle in
A001100 divided by 2 (except for T(1, 0)).
A010028 transposed.
-
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)-> ceil(coeff(S(n), t, k)/2):
seq(seq(T(n, k), k=0..n-1), n=1..10); # Alois P. Heinz, Jan 11 2013
-
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]/2]; Table[Table[T[n, k], {k, 0, n-1}], {n, 1, 11}] // Flatten (* Jean-François Alcover, Jan 14 2014, translated from Alois P. Heinz's Maple code *)
A000239
One-half of number of permutations of [n] with exactly one run of adjacent symbols differing by 1.
Original entry on oeis.org
1, 1, 3, 8, 28, 143, 933, 7150, 62310, 607445, 6545935, 77232740, 989893248, 13692587323, 203271723033, 3223180454138, 54362625941818, 971708196867905, 18347779304380995, 364911199401630640, 7624625589633857940, 166977535317365068775, 3824547112283439914893, 91440772473772839055238
Offset: 1
The permutation 3 2 1 4 5 7 6 has three such runs: 3-2-1, 4-5 and 7-6.
For n<=3 all permutations have one such run. For n=4, 16 have one run, two have no such runs (2413 and 3142), and 6 have two runs (1243, 2134, 2143, 3412, 3421), so a(4) = 16/2 = 8.
- F. N. David, M. G. Kendall and D. E. Barton, Symmetric Function and Allied Tables, Cambridge, 1966, p. 264, Table 7.6.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).
This is a diagonal of the irregular triangle in
A010030.
-
S[n_] := S[n] = If[n<4, {1, 1, 2*t, 4*t + 2*t^2}[[n+1]], (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]]; A000239 = Join[{1}, Table[Coefficient[S[n], t, 1]/2, {n, 1, 20}] // Accumulate // Rest] (* Jean-François Alcover, Feb 06 2016, from successive accumulation of A000130 *)
Showing 1-10 of 12 results.
Comments