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 10 results.

A001250 Number of alternating permutations of order n.

Original entry on oeis.org

1, 1, 2, 4, 10, 32, 122, 544, 2770, 15872, 101042, 707584, 5405530, 44736512, 398721962, 3807514624, 38783024290, 419730685952, 4809759350882, 58177770225664, 740742376475050, 9902996106248192, 138697748786275802, 2030847773013704704, 31029068327114173810
Offset: 0

Views

Author

Keywords

Comments

For n>1, a(n) is the number of permutations of order n with the length of longest run equal 2.
Boustrophedon transform of the Euler numbers (A000111). [Berry et al., 2013] - N. J. A. Sloane, Nov 18 2013
Number of inversion sequences of length n where all consecutive subsequences i,j,k satisfy i >= j < k or i < j >= k. a(4) = 10: 0010, 0011, 0020, 0021, 0022, 0101, 0102, 0103, 0112, 0113. - Alois P. Heinz, Oct 16 2019

Examples

			1 + x + 2*x^2 + 4*x^3 + 10*x^4 + 32*x^5 + 122*x^6 + 544*x^7 + 2770*x^8 + ...
From _Gus Wiseman_, Jun 21 2021: (Start)
The a(0) = 1 through a(4) = 10 permutations:
  ()  (1)  (1,2)  (1,3,2)  (1,3,2,4)
           (2,1)  (2,1,3)  (1,4,2,3)
                  (2,3,1)  (2,1,4,3)
                  (3,1,2)  (2,3,1,4)
                           (2,4,1,3)
                           (3,1,4,2)
                           (3,2,4,1)
                           (3,4,1,2)
                           (4,1,3,2)
                           (4,2,3,1)
(End)
		

References

  • L. Comtet, Advanced Combinatorics, Reidel, 1974, p. 261.
  • F. N. David, M. G. Kendall and D. E. Barton, Symmetric Function and Allied Tables, Cambridge, 1966, p. 262.
  • 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. A000111. A diagonal of A010094.
The version for permutations of prime indices is A345164.
The version for compositions is A025047, ranked by A345167.
The version for patterns is A345194.
A049774 counts permutations avoiding adjacent (1,2,3).
A344614 counts compositions avoiding adjacent (1,2,3) and (3,2,1).
A344615 counts compositions avoiding the weak adjacent pattern (1,2,3).
A344654 counts partitions without a wiggly permutation, ranked by A344653.
A345170 counts partitions with a wiggly permutation, ranked by A345172.
A345192 counts non-wiggly compositions, ranked by A345168.
Row sums of A104345.

Programs

  • Haskell
    a001250 n = if n == 1 then 1 else 2 * a000111 n
    -- Reinhard Zumkeller, Sep 17 2014
    
  • Maple
    # With Eulerian polynomials:
    A := (n, x) -> `if`(n<2, 1/2/(1+I)^(1-n), add(add((-1)^j*binomial(n+1, j)*(m+1-j)^n, j=0..m)*x^m, m=0..n-1)):
    A001250 := n -> 2*(I-1)^(1-n)*exp(I*(n-1)*Pi/2)*A(n,I);
    seq(A001250(i), i=0..22); # Peter Luschny, May 27 2012
    # second Maple program:
    b:= proc(u, o) option remember;
          `if`(u+o=0, 1, add(b(o-1+j, u-j), j=1..u))
        end:
    a:= n-> `if`(n<2, 1, 2)*b(n, 0):
    seq(a(n), n=0..30);  # Alois P. Heinz, Nov 29 2015
  • Mathematica
    a[n_] := 4*Abs[PolyLog[-n, I]]; a[0] = a[1] = 1; Table[a[n], {n, 0, 25}] (* Jean-François Alcover, Jan 09 2016, after M. F. Hasler *)
    Table[Length[Select[Permutations[Range[n]],And@@(!(OrderedQ[#]||OrderedQ[Reverse[#]])&/@Partition[#,3,1])&]],{n,8}] (* Gus Wiseman, Jun 21 2021 *)
    a[0]:=1; a[1]:=1; a[n_]:=a[n]=1/(n (n-1)) Sum[a[n-1-k] a[k] k, {k,1, n-1}]; Join[{a[0], a[1]}, Map[2 #! a[#]&, Range[2,24]]] (* Oliver Seipel, May 27 2024 *)
  • PARI
    {a(n) = local(v=[1], t); if( n<0, 0, for( k=2, n+3, t=0; v = vector( k, i, if( i>1, t += v[k+1 - i]))); v[3])} /* Michael Somos, Feb 03 2004 */
    
  • PARI
    {a(n) = if( n<0, 0, n! * polcoeff( (tan(x + x * O(x^n)) + 1 / cos(x + x * O(x^n)))^2, n))} /* Michael Somos, Feb 05 2011 */
    
  • PARI
    A001250(n)=sum(m=0,n\2,my(k);(-1)^m*sum(j=0,k=n+1-2*m,binomial(k,j)*(-1)^j*(k-2*j)^(n+1))/k>>k)*2-(n==1)  \\ M. F. Hasler, May 19 2012
    
  • PARI
    A001250(n)=4*abs(polylog(-n,I))-(n==1)  \\ M. F. Hasler, May 20 2012
    
  • PARI
    my(x='x+O('x^66), egf=1+2*(tan(x)+1/cos(x))-2-x); Vec(serlaplace(egf)) /* Joerg Arndt, May 28 2012 */
    
  • Python
    from itertools import accumulate, islice
    def A001250_gen(): # generator of terms
        yield from (1,1)
        blist = (0,2)
        while True:
            yield (blist := tuple(accumulate(reversed(blist),initial=0)))[-1]
    A001250_list = list(islice(A001250_gen(),40)) # Chai Wah Wu, Jun 09-11 2022
    
  • Python
    from sympy import bernoulli, euler
    def A001250(n): return 1 if n<2 else abs(((1<Chai Wah Wu, Nov 13 2024
  • Sage
    # Algorithm of L. Seidel (1877)
    def A001250_list(n) :
        R = [1]; A = {-1:0, 0:2}; k = 0; e = 1
        for i in (0..n) :
            Am = 0; A[k + e] = 0; e = -e
            for j in (0..i) : Am += A[k]; A[k] = Am; k += e
            if i > 1 : R.append(A[-i//2] if i%2 == 0 else A[i//2])
        return R
    A001250_list(22) # Peter Luschny, Mar 31 2012
    

Formula

a(n) = coefficient of x^(n-1)/(n-1)! in power series expansion of (tan(x) + sec(x))^2 = (tan(x)+1/cos(x))^2.
a(n) = coefficient of x^n/n! in power series expansion of 2*(tan(x) + sec(x)) - 2 - x. - Michael Somos, Feb 05 2011
For n>1, a(n) = 2 * A000111(n). - Michael Somos, Mar 19 2011
a(n) = 4*|Li_{-n}(i)| - [n=1] = Sum_{m=0..n/2} (-1)^m*2^(1-k)*Sum_{j=0..k} binomial(k,j)*(-1)^j*(k-2*j)^(n+1)/k - [n=1], where k = k(m) = n+1-2*m and [n=1] equals 1 if n=1 and zero else; Li denotes the polylogarithm (and i^2 = -1). - M. F. Hasler, May 20 2012
From Sergei N. Gladkovskii, Jun 18 2012: (Start)
Let E(x) = 2/(1-sin(x))-1 (essentially the e.g.f.), then
E(x) = -1 + 2*(-1/x + 1/(1-x)/x - x^3/((1-x)*((1-x)*G(0) + x^2))) where G(k) = (2*k+2)*(2*k+3)-x^2+(2*k+2)*(2*k+3)*x^2/G(k+1); (continued fraction, Euler's 1st kind, 1-step).
E(x) = -1 + 2*(-1/x + 1/(1-x)/x - x^3/((1-x)*((1-x)*G(0) + x^2))) where G(k) = 8*k + 6 - x^2/(1 + (2*k+2)*(2*k+3)/G(k+1)); (continued fraction, Euler's 2nd kind, 2-step).
E(x) = (tan(x) + sec(x))^2 = -1 + 2/(1-x*G(0)) where G(k) = 1 - x^2/(2*(2*k+1)*(4*k+3) - 2*x^2*(2*k+1)*(4*k+3)/(x^2 - 4*(k+1)*(4*k+5)/G(k+1))); (continued fraction, 3rd kind, 3-step).
(End)
G.f.: conjecture: 2*T(0)/(1-x) -1, where T(k) = 1 - x^2*(k+1)*(k+2)/(x^2*(k+1)*(k+2) - 2*(1-x*(k+1))*(1-x*(k+2))/Q(k+1) ); (continued fraction). - Sergei N. Gladkovskii, Nov 19 2013
a(n) ~ 2^(n+3) * n! / Pi^(n+1). - Vaclav Kotesovec, Sep 06 2014
a(n) = Sum_{k=0..n-1} A109449(n-1,k)*A000111(k). - Reinhard Zumkeller, Sep 17 2014

Extensions

Edited by Max Alekseyev, May 04 2012
a(0)=1 prepended by Alois P. Heinz, Nov 29 2015

A010026 Triangle read by rows: number of permutations of 1..n by length of longest run.

Original entry on oeis.org

2, 2, 4, 2, 12, 10, 2, 16, 70, 32, 2, 20, 134, 442, 122, 2, 24, 198, 1164, 3108, 544, 2, 28, 274, 2048, 10982, 24216, 2770, 2, 32, 362, 3204, 22468, 112354, 208586, 15872, 2, 36, 462, 4720, 39420, 264538, 1245676, 1972904, 101042
Offset: 2

Views

Author

Keywords

Examples

			Triangle begins:
  2,
  2,  4,
  2, 12,  10,
  2, 16,  70,   32,
  2, 20, 134,  442,   122,
  2, 24, 198, 1164,  3108,    544,
  2, 28, 274, 2048, 10982,  24216,   2770,
  2, 32, 362, 3204, 22468, 112354, 208586, 15872, ...
The row "2, 12, 10" for example means that there are two permutations of [1..4] in which the longest run up or down has length 4, 12 in which the longest run has length 3, and 10 in which the longest run has length 2.
The following table, computed by _Sean A. Irvine_, May 02 2012, gives an extended version of the triangle, oriented the right way round (cf. A211318), and corrects errors in David Kendall and Barton:
n l=0, l=1, l=2, l=3, etc.
----------------------------
1 [0, 1]
2 [0, 0, 2]
3 [0, 0, 4, 2]
4 [0, 0, 10, 12, 2]
5 [0, 0, 32, 70, 16, 2]
6 [0, 0, 122, 442, 134, 20, 2]
7 [0, 0, 544, 3108, 1164, 198, 24, 2]
8 [0, 0, 2770, 24216, 10982, 2048, 274, 28, 2]A049293
9 [0, 0, 15872, 208586, 112354, 22468, 3204, 362, 32, 2]
10 [0, 0, 101042, 1972904, 1245676, 264538, 39420, 4720, 462, 36, 2]
11 [0, 0, 707584, 20373338, 14909340, 3340962, 514296, 64020, 6644, 574, 40, 2]
12 [0, 0, 5405530, 228346522, 191916532, 45173518, 7137818, 913440, 98472, 9024, 698, 44, 2]
13 [0, 0, 44736512, 2763212980, 2646100822, 652209564, 105318770, 13760472, 1523808, 145080, 11908, 834, 48, 2]
14 [0, 0, 398721962, 35926266244, 38932850396, 10024669626, 1649355338, 219040274, 24744720, 2419872, 206388, 15344, 982, 52, 2]
15 [0, 0, 3807514624, 499676669254, 609137502242, 163546399460, 27356466626, 3681354658, 422335056, 42129360, 3690960, 285180, 19380, 1142, 56, 2]
		

References

  • F. N. David, M. G. Kendall and D. E. Barton, Symmetric Function and Allied Tables, Cambridge, 1966, p. 262. (Probably contains errors for n >= 13.)

Crossrefs

Programs

  • Mathematica
    (* This program is unsuited for a large number of terms *) f[p_List] := Max[Length /@ Split[Differences[p], #1*#2 > 0 &]] + 1; row[n_] := Sort[Tally[f /@ Permutations[Range[n]]], First[#1] > First[#2] &][[All, 2]]; Table[rn = row[n]; Print["n = ", n, " ", rn]; rn, {n, 2, 10}] // Flatten (* Jean-François Alcover, Mar 12 2014 *)
    T[n_, length_] := Module[{g, b},
    g[u_, o_, t_] := g[u, o, t] = If[u+o == 0, 1, Sum[g[o + j - 1, u - j, 2], {j, 1, u}] + If[tJean-François Alcover, Aug 18 2018, after Alois P. Heinz *)

Extensions

Edited by N. J. A. Sloane, May 02 2012

A211318 Triangle read by rows: number of permutations of 1..n by length l of longest run (n >= 1, 1 <= l <= n).

Original entry on oeis.org

1, 0, 2, 0, 4, 2, 0, 10, 12, 2, 0, 32, 70, 16, 2, 0, 122, 442, 134, 20, 2, 0, 544, 3108, 1164, 198, 24, 2, 0, 2770, 24216, 10982, 2048, 274, 28, 2, 0, 15872, 208586, 112354, 22468, 3204, 362, 32, 2, 0, 101042, 1972904, 1245676, 264538, 39420, 4720, 462, 36, 2, 0
Offset: 1

Views

Author

N. J. A. Sloane, May 02 2012, based on computations by Sean A. Irvine

Keywords

Examples

			Triangle begins:
n l=1, l=2, l=3, etc...
1 [1]
2 [0, 2]
3 [0, 4, 2]
4 [0, 10, 12, 2]
5 [0, 32, 70, 16, 2]
6 [0, 122, 442, 134, 20, 2]
7 [0, 544, 3108, 1164, 198, 24, 2]
8 [0, 2770, 24216, 10982, 2048, 274, 28, 2]
9 [0, 15872, 208586, 112354, 22468, 3204, 362, 32, 2]
10 [0, 101042, 1972904, 1245676, 264538, 39420, 4720, 462, 36, 2]
11 [0, 707584, 20373338, 14909340, 3340962, 514296, 64020, 6644, 574, 40, 2]
12 [0, 5405530, 228346522, 191916532, 45173518, 7137818, 913440, 98472, 9024, 698, 44, 2]
13 [0, 44736512, 2763212980, 2646100822, 652209564, 105318770, 13760472, 1523808, 145080, 11908, 834, 48, 2]
14 [0, 398721962, 35926266244, 38932850396, 10024669626, 1649355338, 219040274, 24744720, 2419872, 206388, 15344, 982, 52, 2]
15 [0, 3807514624, 499676669254, 609137502242, 163546399460, 27356466626, 3681354658, 422335056, 42129360, 3690960, 285180, 19380, 1142, 56, 2],
...
More rows than usual are shown, in order to correct errors in David, Kendall and Barton.
		

References

  • F. N. David, M. G. Kendall and D. E. Barton, Symmetric Function and Allied Tables, Cambridge, 1966, p. 262. (Contains errors for n >= 13.)
  • Sean A. Irvine, Posting to Sequence Fans Mailing List, May 02 2012

Crossrefs

Mirror image of triangle in A010026.

Programs

  • Mathematica
    <Wouter Meeussen, May 09 2012 *)
    T[n_, length_] := Module[{g, b},
    g[u_, o_, t_] := g[u, o, t] = If[u+o == 0, 1, Sum[g[o + j - 1, u - j, 2], {j, 1, u}] + If[t1, 1] = 0;
    Table[T[n, k], {n, 1, 10}, {k, 1, n}] // Flatten (* Jean-François Alcover, Aug 18 2018, after Alois P. Heinz *)

A001251 Number of permutations of order n with the length of longest run equal to 3.

Original entry on oeis.org

0, 0, 2, 12, 70, 442, 3108, 24216, 208586, 1972904, 20373338, 228346522, 2763212980, 35926266244, 499676669254, 7405014187564, 116511984902094, 1940073930857802, 34087525861589564, 630296344519286304, 12235215845125112122, 248789737587365945992
Offset: 1

Views

Author

Keywords

References

  • F. N. David, M. G. Kendall and D. E. Barton, Symmetric Function and Allied Tables, Cambridge, 1966, p. 262. (Terms for n>=13 are incorrect.)
  • 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

Programs

  • Mathematica
    length = 3;
    g[u_, o_, t_] := g[u, o, t] = If[u+o == 0, 1, Sum[g[o + j - 1, u - j, 2], {j, 1, u}] + If[tJean-François Alcover, Aug 18 2018, after Alois P. Heinz *)

Formula

a(n) ~ c * d^n * n!, where d = 0.92403585760753647721113386869798700855648617941... is the root of the equation 8 - 2*sin(sqrt(phi)/d) * (2*sqrt(5*(phi-1)) * cosh(sqrt(phi-1)/d) + 2*sinh(sqrt(phi-1)/d)) + 2*cos(sqrt(phi)/d) * (6*cosh(sqrt(phi-1)/d) + 2*sqrt(5*phi) * sinh(sqrt(phi-1)/d)) = 0, phi = A001622 = (1+sqrt(5))/2 is the golden ratio and c = 1.259371257828351725264434486385284120241474052544197367866029465830756911... - Vaclav Kotesovec, Sep 06 2014, updated Aug 18 2018

Extensions

Corrected and extended by Max Alekseyev at the suggestion of Sean A. Irvine, May 04 2012

A001253 Number of permutations of order n with the length of longest run equal to 5.

Original entry on oeis.org

0, 0, 0, 0, 2, 20, 198, 2048, 22468, 264538, 3340962, 45173518, 652209564, 10024669626, 163546399460, 2823941647390, 51468705947590, 987671243816650, 19909066390361346, 420650676776338140, 9297308938203169622, 214562999510569012168
Offset: 1

Views

Author

Keywords

References

  • F. N. David, M. G. Kendall and D. E. Barton, Symmetric Function and Allied Tables, Cambridge, 1966, p. 262. (Terms for n>=13 are incorrect.)
  • 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

Programs

  • Mathematica
    length = 5;
    g[u_, o_, t_] := g[u, o, t] = If[u+o == 0, 1, Sum[g[o + j - 1, u - j, 2], {j, 1, u}] + If[tJean-François Alcover, Aug 18 2018, after Alois P. Heinz *)

Extensions

Corrected and extended by Max Alekseyev at the suggestion of Sean A. Irvine, May 04 2012

A000303 Number of permutations of [n] in which the longest increasing run has length 2.

Original entry on oeis.org

0, 1, 4, 16, 69, 348, 2016, 13357, 99376, 822040, 7477161, 74207208, 797771520, 9236662345, 114579019468, 1516103040832, 21314681315997, 317288088082404, 4985505271920096, 82459612672301845, 1432064398910663704, 26054771465540507272
Offset: 1

Views

Author

Keywords

Examples

			a(3)=4 because we have (13)2, 2(13), (23)1, 3(12), where the parentheses surround increasing runs of length 2.
		

References

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

Column 2 of A008304. Other columns: A000402, A000434, A000456, A000467, A230055.
Equals 1 less than A049774. - Greg Dresden, Feb 22 2020

Programs

  • Mathematica
    b[u_, o_, t_, k_] := b[u, o, t, k] = If[t == k, (u + o)!, If[Max[t, u] + o < k, 0, Sum[b[u + j - 1, o - j, t + 1, k], {j, 1, o}] + Sum[b[u - j, o + j - 1, 1, k], {j, 1, u}]]];
    T[n_, k_] := b[0, n, 0, k] - b[0, n, 0, k + 1];
    a[n_] := T[n, 2];
    Array[a, 30] (* Jean-François Alcover, Jul 19 2018, after Alois P. Heinz *)

Extensions

Better description from Emeric Deutsch, May 08 2004
Edited and extended by Max Alekseyev, May 20 2012

A000402 Number of permutations of [n] in which the longest increasing run has length 3.

Original entry on oeis.org

0, 0, 1, 6, 41, 293, 2309, 19975, 189524, 1960041, 21993884, 266361634, 3465832370, 48245601976, 715756932697, 11277786883720, 188135296651083, 3313338641692957, 61444453534759589, 1196988740015236617, 24442368179977776766, 522124104504306695929
Offset: 1

Views

Author

Keywords

Examples

			a(4)=6 because we have (124)3, (134)2, (234)1, 4(123), 3(124) and 2(134), where the parentheses surround increasing runs of length 3.
		

References

  • F. N. David, M. G. Kendall and D. E. Barton, Symmetric Function and Allied Tables, Cambridge, 1966, p. 261, Table 7.4.1. (Values for n>=16 are incorrect.)
  • 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

Column 3 of A008304. Other columns: A000303, A000434, A000456, A000467.

Programs

  • Mathematica
    b[u_, o_, t_, k_] := b[u, o, t, k] = If[t == k, (u + o)!, If[Max[t, u] + o < k, 0, Sum[b[u + j - 1, o - j, t + 1, k], {j, 1, o}] + Sum[b[u - j, o + j - 1, 1, k], {j, 1, u}]]];
    T[n_, k_] := b[0, n, 0, k] - b[0, n, 0, k + 1];
    a[n_] := T[n, 3];
    Array[a, 30] (* Jean-François Alcover, Jul 19 2018, after Alois P. Heinz *)

Extensions

Better description from Emeric Deutsch, May 08 2004
Terms a(16), a(17) are corrected and further terms added by Max Alekseyev, May 20 2012

A000434 Number of permutations of [n] in which the longest increasing run has length 4.

Original entry on oeis.org

0, 0, 0, 1, 8, 67, 602, 5811, 60875, 690729, 8457285, 111323149, 1569068565, 23592426102, 377105857043, 6387313185576, 114303481217657, 2155348564847332, 42719058006864690, 887953677898186108, 19316200230609433690, 438920223893512987430
Offset: 1

Views

Author

Keywords

Examples

			a(5)=8 because we have (1235)4, (1245)3, (1345)2, (2345)1, 5(1234), 4(1235), 3(1245) and 2(1345), where the parentheses surround increasing runs of length 4.
		

References

  • F. N. David, M. G. Kendall and D. E. Barton, Symmetric Function and Allied Tables, Cambridge, 1966, p. 261. (Values for n>=16 are incorrect.)
  • 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

Column 4 of A008304. Other columns: A000303, A000402, A000456, A000467.

Programs

  • Mathematica
    b[u_, o_, t_, k_] := b[u, o, t, k] = If[t == k, (u + o)!, If[Max[t, u] + o < k, 0, Sum[b[u + j - 1, o - j, t + 1, k], {j, 1, o}] + Sum[b[u - j, o + j - 1, 1, k], {j, 1, u}]]];
    T[n_, k_] := b[0, n, 0, k] - b[0, n, 0, k + 1];
    a[n_] := T[n, 4];
    Array[a, 30] (* Jean-François Alcover, Jul 19 2018, after Alois P. Heinz *)

Extensions

Better description from Emeric Deutsch, May 08 2004
Terms a(16)-a(18) corrected and further terms added by Max Alekseyev, May 20 2012

A000456 Number of permutations of [n] in which the longest increasing run has length 5.

Original entry on oeis.org

0, 0, 0, 0, 1, 10, 99, 1024, 11304, 133669, 1695429, 23023811, 333840443, 5153118154, 84426592621, 1463941342191, 26793750988542, 516319125748337, 10451197169218523, 221738082618710329, 4921234092461339819, 114041894068935641488
Offset: 1

Views

Author

Keywords

Examples

			a(6)=10 because we have (12346)5, (12356)4, (12456)3, (13456)2, (23456)1, 6(12345), 5(12346), 4(12356), 3(12456) and 2(13456), where the parentheses surround increasing runs of length 5.
		

References

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

Column 5 of A008304. Other columns: A000303, A000402, A000434, A000467.

Programs

  • Mathematica
    b[u_, o_, t_, k_] := b[u, o, t, k] = If[t == k, (u + o)!, If[Max[t, u] + o < k, 0, Sum[b[u + j - 1, o - j, t + 1, k], {j, 1, o}] + Sum[b[u - j, o + j - 1, 1, k], {j, 1, u}]]]; T[n_, k_] := b[0, n, 0, k] - b[0, n, 0, k + 1]; a[n_] := T[n, 5]; Array[a, 25] (* Jean-François Alcover, Feb 08 2016, after Alois P. Heinz in A008304 *)

Extensions

Better description from Emeric Deutsch, May 08 2004
Edited and extended by Max Alekseyev, May 20 2012

A000467 Number of permutations of [n] in which the longest increasing run has length 6.

Original entry on oeis.org

0, 0, 0, 0, 0, 1, 12, 137, 1602, 19710, 257400, 3574957, 52785901, 827242933, 13730434111, 240806565782, 4452251786946, 86585391630673, 1767406549387381, 37790452850585180, 844817788372455779, 19711244788916894489, 479203883157602851294
Offset: 1

Views

Author

Keywords

References

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

Column 6 of A008304. Other columns: A000303, A000402, A000434, A000456.

Programs

  • Mathematica
    b[u_, o_, t_, k_] := b[u, o, t, k] = If[t == k, (u + o)!, If[Max[t, u] + o < k, 0, Sum[b[u + j - 1, o - j, t + 1, k], {j, 1, o}] + Sum[b[u - j, o + j - 1, 1, k], {j, 1, u}]]]; T[n_, k_] := b[0, n, 0, k] - b[0, n, 0, k + 1]; a[n_] := T[n, 6]; Array[a, 23] (* Jean-François Alcover, Feb 08 2016, after Alois P. Heinz in A008304 *)

Extensions

Edited and extended by Max Alekseyev, May 20 2012
Showing 1-10 of 10 results.