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

A158005 Numbers of pattern-matching permutations of (1234) for the permutations of {1, 2, ..., n} on n = 4, 5, 6, ... elements.

Original entry on oeis.org

1, 17, 207, 2279, 24553, 268521, 3042210, 36153510, 454208895, 6059942223, 86030083110, 1299647574882, 20865826165777, 355277740280849, 6399391841784282, 121623163346687166, 2432739049821421911, 51089720946192154791, 1123991502048375026337
Offset: 4

Views

Author

Eric W. Weisstein, Mar 11 2009

Keywords

Comments

Same series for 1243 1432 2134 2143 4123 3214 3412 2341 3421 4321 4312. - R. H. Hardin, Mar 15 2009

Crossrefs

Programs

  • Maple
    h:= proc(l) local n; n:=nops(l); add(i, i=l)!/mul(mul(1+l[i]-j
          +add(`if`(l[k]>=j, 1, 0), k=i+1..n), j=1..l[i]), i=1..n)
        end:
    g:= proc(n, i, l)
          `if`(n=0 or i=1, h([l[], 1$n])^2, `if`(i<1, 0,
           add(g(n-i*j, i-1, [l[], i$j]), j=0..n/i)))
        end:
    a:= n-> n! -g(n, 3, []):
    seq(a(n), n=4..30);  # Alois P. Heinz, Jul 05 2012
    # second Maple program
    a:= proc(n) option remember; `if`(n<3, 0, `if`(n=4, 1,
          ((13-11*n-40*n^2+10*n^3+n^4)*a(n-1) -(10*n^2-9*n-31)*(n-1)^2*a(n-2)
           +9*(n-1)^2*(n-2)^2*a(n-3)) / ((n-4)*(n+2)^2)))
        end:
    seq(a(n), n=4..30);  # Alois P. Heinz, Sep 26 2012
  • Mathematica
    a[2] = a[3] = 0; a[4] = 1; a[n_] := a[n] = (1/((n-4)*(n+2)^2))* (9*(n-2)^2*a[n-3]*(n-1)^2 - (10*n^2 - 9*n - 31)*a[n-2]*(n-1)^2 + (n^4 + 10*n^3 - 40*n^2 - 11*n + 13)*a[n-1]); Table[a[n], {n, 4, 22}] (* Jean-François Alcover, Oct 22 2012, after Alois P. Heinz *)

Formula

a(n) = A214152(n,4) = A000142(n) - A005802(n) = A000142(n) - A214015(n,3). - Alois P. Heinz, Jul 05 2012

Extensions

More terms from R. H. Hardin, Mar 15 2009
Two more terms from Vladeta Jovovic, Aug 17 2009
Corrected a(19)-a(20) and extended by Alois P. Heinz, Jul 05 2012

A000139 a(n) = 2*(3*n)! / ((2*n+1)!*(n+1)!).

Original entry on oeis.org

2, 1, 2, 6, 22, 91, 408, 1938, 9614, 49335, 260130, 1402440, 7702632, 42975796, 243035536, 1390594458, 8038677054, 46892282815, 275750636070, 1633292229030, 9737153323590, 58392041019795, 352044769046880, 2132866978427640, 12980019040145352, 79319075627675556
Offset: 0

Views

Author

N. J. A. Sloane, entry revised Apr 24 2012

Keywords

Comments

This sequence arises in many different contexts, and over the years it has had several different definitions. I have now changed the definition back to one of the earlier ones, a self-contained formula. - N. J. A. Sloane, Apr 24 2012
The number of 2-stack sortable permutations on n letters (n >= 1).
The number of rooted non-separable planar maps with n+1 edges. - Valery A. Liskovets, Mar 17 2005
The shifted sequence starting with a(1): Number of quadrangular dissections of a square, counted by the number of vertices. Rooted, non-separable planar maps with no multiple edges, in which each non-root face has degree 4.
Number of left ternary trees having n nodes (n>=1). - Emeric Deutsch, Jul 23 2006
A combinatorial interpretation for this sequence in terms of a family of plane trees is given in [Schaeffer, Corollary 2 with k = 3]. - Peter Bala, Oct 12 2011
Number of canopy intervals in the Tamari lattices, see [Préville-Ratelle and Viennot, section 6]. - F. Chapoton, Apr 19 2015
The number of fighting fish (branching polyominoes). - David Bevan, Jan 10 2018
The number of 1324-avoiding dominoes (gridded permutations). - David Bevan, Jan 10 2018
For n > 0, a(n) is the number of simple strong triangulations of a fixed quadrilateral with n interior nodes. See A210664. - Andrew Howroyd, Feb 24 2021
Conjecture: a(n) is odd iff n is a term of A022341. - Peter Bala, Jul 24 2025

Examples

			G.f. = 2 + x + 2*x^2 + 6*x^3 + 22*x^4 + 91*x^5 + 408*x^6 + 1938*x^7 + ...
		

References

  • Miklos Bona, editor, Handbook of Enumerative Combinatorics, CRC Press, 2015, page 365.
  • Eric S. Egge, Defying God: The Stanley-Wilf Conjecture, Stanley-Wilf Limits, and a Two-Generation Explosion of Combinatorics, pp. 65-82 of "A Century of Advancing Mathematics", ed. S. F. Kennedy et al., MAA Press 2015.
  • J. L. Gross and J. Yellen, eds., Handbook of Graph Theory, CRC Press, 2004; p. 714.
  • S. Kitaev, Patterns in Permutations and Words, Springer-Verlag, 2011. See p. 399 Table A.7
  • W. F. Lunnon, Counting polyominoes, pp. 347-372 of A. O. L. Atkin and B. J. Birch, editors, Computers in Number Theory. Academic Press, NY, 1971.
  • 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.41.

Crossrefs

Programs

  • Haskell
    a000139 0 = 2
    a000139 n = ((3 * n) `a007318` (2 * n + 1)) `div` a000217 n
    -- Reinhard Zumkeller, Feb 17 2013
    
  • Magma
    [2*Factorial(3*n)/(Factorial(2*n+1)*Factorial(n+1)): n in [0..25]]; // Vincenzo Librandi, Apr 20 2015
  • Maple
    A000139 := n->2*(3*n)!/((2*n+1)!*((n+1)!)): seq(A000139(n), n=0..23);
  • Mathematica
    Table[(2(3n)!)/((2n+1)!(n+1)!),{n,0,30}] (* Harvey P. Dale, Mar 31 2013 *)
  • PARI
    a(n)=binomial(3*n,n)*2/((n+1)*(2*n+1)); \\ Joerg Arndt, Jul 21 2014
    
  • Python
    from sympy import binomial
    def A000139(n): return (binomial(3*n, n)*2)//((n+1)*(2*n+1))
    
  • Python
    A000139_list = [2]
    for n in range(1,30):
        A000139_list.append(3*(3*n-2)*(3*n-1)*A000139_list[-1]//(2*n+2)//(2*n+1)) # Chai Wah Wu, Apr 02 2021
    
  • Sage
    def A000139(n): return (binomial(3*n, n)*2)//((n+1)*(2*n+1))
    [A000139(n) for n in (0..23)]  # Peter Luschny, Jun 17 2013
    

Formula

a(n) = 2*binomial(3*n, 2*n+1)/(n*(n+1)), or 2*(3*n)!/((2*n+1)!*((n+1)!)).
Using Stirling's formula in A000142 it is easy to get the asymptotic expression a(n) ~ (27/4)^n / (sqrt(Pi*n / 3) * (2*n + 1) * (n + 1)). - Dan Fux (dan.fux(AT)OpenGaia.com or danfux(AT)OpenGaia.com), Apr 13 2001
G.f.: A(z) = 2 + z*B(z), where B(z) = 1 - 8*z + 2*z*(5-6*z)*B - 2*z^2*(1+3*z)*B^2 - z^4*B^3.
G.f.: (2/(3*x)) * (hypergeom([-2/3, -1/3],[1/2],(27/4)*x)-1). - Mark van Hoeij, Nov 02 2009
G.f.: (2-3*R)/(R-1)^2 where R := RootOf(x-t*(t-1)^2,t) is an algebraic function in Maple notation. - Mark van Hoeij, Nov 08 2011
G.f.: 2*Q(0), where Q(k) = 1 + 3*x*(3*k+1)*(6*k+1)/(2*(k+1)*(4*k+3) - 6*x*(k+1)*(3*k+2)*(4*k+3)*(6*k+5)/(3*x*(3*k+2)*(6*k+5) + (2*k+3)*(4*k+5)/Q(k+1))); (continued fraction). - Sergei N. Gladkovskii, Apr 30 2013
E.g.f.: 2*Q(0), where Q(k) = 1 + 3*x*(3*k+1)*(6*k+1)/(2*(k+1)*(2*k+1)*(4*k+3) - 6*x*(k+1)*(2*k+1)*(3*k+2)*(4*k+3)*(6*k+5)/(3*x*(3*k+2)*(6*k+5) + (2*k+2)*(2*k+3)*(4*k+5)/Q(k+1))); (continued fraction). - Sergei N. Gladkovskii, Apr 30 2013
a(n) = A007318(3*n, 2*n+1)/A000217(n) for n > 0. - Reinhard Zumkeller, Feb 17 2013
a(n) is the n-th Hausdorff moment of the positive function w(x) defined on (0,27) which is equal to w(x) = 3*sqrt(3)*2^(2/3)*(3-sqrt(81-12*x)/9)*(1+sqrt(81-12*x)/9)^(1/3)/(8*Pi*x^(2/3))-sqrt(3)*2^(1/3)*(3+sqrt(81-12*x)/9)*(1+sqrt(81-12*x)/9)^(-1/3)/(4*Pi*x^(1/3)), that is, a(n) is the integral Integral_{x=0..27/4} x^n*w(x) dx, n >= 0. The function w(x) is unique. - Karol A. Penson, Jun 17 2013
D-finite with recurrence 2*(n+1)*(2*n+1)*a(n) -3*(3*n-1)*(3*n-2)*a(n-1)=0. - R. J. Mathar, Aug 21 2014
G.f. A(z) is related to the g.f. M(z) of A000168 by M(z) = 1 + A(z*M(z)^2) (see Tutte 1963, equation 6.3). - Noam Zeilberger, Nov 02 2016
From Ilya Gutkovskiy, Jan 17 2017: (Start)
E.g.f.: 2*2F2(1/3,2/3; 3/2,2; 27*x/4).
Sum_{n>=0} 1/a(n) = (1/2)*3F2(1,3/2,2; 1/3,2/3; 4/27) = 2.226206199291261... (End)
G.f. A(z) is the solution to the initial value problem 4*A + 2*z*A' = 8 + 3*z*A + 9*z^2*A' + 2*z^2*A*A', A(0) = 2. - Bjarki Ágúst Guðmundsson, Jul 03 2017
a(n+1) = a(n)*3*(3*n+1)*(3*n+2)/(2*(n+2)*(2*n+3)). - Chai Wah Wu, Apr 02 2021
a(n) = 4*(3*n)!/(n!*(2*n+2)!). - Chai Wah Wu, Dec 15 2021
From Peter Bala, Feb 05 2022: (Start)
O.g.f.: A(x) = T(x)*(3 - T(x)), where T(x) = 1 + x*T(x)^3 is the o.g.f. of A001764.
(1/x)*(A(x) - 2)/(A(x) - 1) = 1 + x + 3*x^2 + 11*x^3 + 46*x^4 + 209*x^5 + ... is the o.g.f. of A233389.
1 + 2*x*A'(2*x)/A(2*x) = 1 + x + 7*x^2 + 61*x^3 + 591*x^4 + 6101*x^6 + ... is the o.g.f. of A218473.
Let B(x) = 1 + x*(A(x) - 1). Then x*B'(x)/B(x) = x + x^2 + 4*x^3 + 17*x^4 + 81*x^5 + ... is the o.g.f. of A121545. (End)

A047889 Number of permutations in S_n with longest increasing subsequence of length <= 4.

Original entry on oeis.org

1, 1, 2, 6, 24, 119, 694, 4582, 33324, 261808, 2190688, 19318688, 178108704, 1705985883, 16891621166, 172188608886, 1801013405436, 19274897768196, 210573149141896, 2343553478425816, 26525044132374656, 304856947930144656
Offset: 0

Views

Author

Eric Rains (rains(AT)caltech.edu), N. J. A. Sloane

Keywords

Comments

Or, number of permutations in S_n that avoid the pattern 12345, - N. J. A. Sloane, Mar 19 2015
Also, the dimension of the space of SL(4)-invariants in V^m ⊗ (V^*)^m, where V is the standard 4-dimensional representation of SL(4) and V^* its dual. - Alec Mihailovs (alec(AT)mihailovs.com), Aug 14 2005

Examples

			G.f. = 1 + x + 2*x^2 + 6*x^3 + 24*x^4 + 119*x^5 + 694*x^6 + 4582*x^7 + ...
		

Crossrefs

A column of A047888.
Column k=4 of A214015.
Representatives for the 16 Wilf-equivalence patterns of length 5 are given in A116485, A047889, and A256195-A256208. - N. J. A. Sloane, Mar 19 2015

Programs

  • Maple
    A:=rsolve({a(0) = 1, a(1) = 1, (n^3 + 16*n^2 + 85*n + 150)*a(n + 2) = (20*n^3 + 182*n^2 + 510*n + 428)*a(n + 1) - (64*n^3 + 256*n^2 + 320*n +128)*a(n)}, a(n), makeproc): # Alec Mihailovs (alec(AT)mihailovs.com), Aug 14 2005
  • Mathematica
    Flatten[{1,RecurrenceTable[{64*(-1+n)^2*n*a[-2+n]-2*(-12 + 11*n + 31*n^2 + 10*n^3)*a[-1+n] + (3+n)^2*(4+n)*a[n]==0,a[1]==1,a[2]==2},a,{n,20}]}] (* Vaclav Kotesovec, Sep 10 2014 *)
  • PARI
    {a(n) = my(v); if( n<2, n>=0, v = vector(n+1, k, 1); for(k=2, n, v[k+1] = ((20*k^3 + 62*k^2 + 22*k - 24) * v[k] - 64*k*(k-1)^2 * v[k-1]) / ((k+3)^2 * (k+4))); v[n+1])}; /* Michael Somos, Apr 19 2015 */

Formula

a(0)=1, a(1)=1, (n^3 + 16*n^2 + 85*n + 150)*a(n+2) = (20*n^3 + 182*n^2 + 510*n + 428)*a(n+1) - (64*n^3 + 256*n^2 + 320*n + 128)*a(n). - Alec Mihailovs (alec(AT)mihailovs.com), Aug 14 2005
a(n) = (64*(n+1)*(2*n^3 + 21*n^2 + 76*n + 89)*A002895(n) -(8*n^4 + 104*n^3 + 526*n^2 + 1098*n + 776) *A002895(n+1)) / (3*(n+2)^3*(n+3)^3*(n+4)). - Mark van Hoeij, Jun 02 2010
a(n) ~ 3 * 2^(4*n + 9) / (n^(15/2) * Pi^(3/2)). - Vaclav Kotesovec, Sep 10 2014

Extensions

More terms from Naohiro Nomoto, Mar 01 2002
Edited by N. J. A. Sloane, Aug 23 2008 at the suggestion of R. J. Mathar

A214015 Number of permutations A(n,k) in S_n with longest increasing subsequence of length <= k; square array A(n,k), n>=0, k>=0, read by antidiagonals.

Original entry on oeis.org

1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 2, 1, 0, 1, 1, 2, 5, 1, 0, 1, 1, 2, 6, 14, 1, 0, 1, 1, 2, 6, 23, 42, 1, 0, 1, 1, 2, 6, 24, 103, 132, 1, 0, 1, 1, 2, 6, 24, 119, 513, 429, 1, 0, 1, 1, 2, 6, 24, 120, 694, 2761, 1430, 1, 0, 1, 1, 2, 6, 24, 120, 719, 4582, 15767, 4862, 1, 0
Offset: 0

Views

Author

Alois P. Heinz, Jul 01 2012

Keywords

Comments

A(n,k) is also the sum of the squares of numbers of standard Young tableaux (SYT) of height <= k over all partitions of n.
This array is a larger and reflected version of A047888.
Column k>1 is asymptotic to (Product_{j=1..k} j!) * k^(2*n + k^2/2) / (Pi^((k-1)/2) * 2^((k-1)*(k+2)/2) * n^((k^2-1)/2)). - Vaclav Kotesovec, Sep 10 2014

Examples

			A(4,2) = 14 because 14 permutations of {1,2,3,4} do not contain an increasing subsequence of length > 2: 1432, 2143, 2413, 2431, 3142, 3214, 3241, 3412, 3421, 4132, 4213, 4231, 4312, 4321.  Permutation 1423 is not counted because it contains the noncontiguous increasing subsequence 123.
A(4,2) = 14 = 2^2 + 3^2 + 1^2 because the partitions of 4 with <= 2 parts are [2,2], [3,1], [4] with 2, 3, 1 standard Young tableaux, respectively:
  +------+  +------+  +---------+  +---------+  +---------+  +------------+
  | 1  3 |  | 1  2 |  | 1  3  4 |  | 1  2  4 |  | 1  2  3 |  | 1  2  3  4 |
  | 2  4 |  | 3  4 |  | 2 .-----+  | 3 .-----+  | 4 .-----+  +------------+
  +------+  +------+  +---+        +---+        +---+
Square array A(n,k) begins:
  1,  1,   1,    1,    1,    1,    1,    1, ...
  0,  1,   1,    1,    1,    1,    1,    1, ...
  0,  1,   2,    2,    2,    2,    2,    2, ...
  0,  1,   5,    6,    6,    6,    6,    6, ...
  0,  1,  14,   23,   24,   24,   24,   24, ...
  0,  1,  42,  103,  119,  120,  120,  120, ...
  0,  1, 132,  513,  694,  719,  720,  720, ...
  0,  1, 429, 2761, 4582, 5003, 5039, 5040, ...
		

Crossrefs

Differences between A000142 and columns k=0-9 give: A000142 (for n>0), A033312, A056986, A158005, A158432, A159139, A159175, A217675, A217676, A217677.
Main diagonal and first lower diagonal give: A000142, A033312.
A(2n,n-1) gives A269042(n) for n>0.

Programs

  • Maple
    h:= proc(l) local n; n:=nops(l); add(i, i=l)! /mul(mul(1+l[i]-j
          +add(`if`(l[k]>=j, 1, 0), k=i+1..n), j=1..l[i]), i=1..n)
        end:
    g:= (n, i, l)-> `if`(n=0 or i=1, h([l[], 1$n])^2, `if`(i<1, 0,
                     add(g(n-i*j, i-1, [l[], i$j]), j=0..n/i))):
    A:= (n, k)-> `if`(k>=n, n!, g(n, k, [])):
    seq(seq(A(n, d-n), n=0..d), d=0..14);
  • Mathematica
    h[l_] := With[{n = Length[l]}, Sum[i, {i, l}]! / Product[Product[1+l[[i]]-j + Sum[If[l[[k]] >= j, 1, 0], {k, i+1, n}], {j, 1, l[[i]]}], {i, 1, n}]];
    g[n_, i_, l_] := If[n == 0 || i == 1, h[Join[l, Array[1&, n]]]^2, If[i < 1, 0, Sum[g[n - i*j, i-1, Join[l, Array[i&, j]]], {j, 0, n/i}]]];
    A[n_, k_] := If[k >= n, n!, g[n, k, {}]];
    Table [Table [A[n, d-n], {n, 0, d}], {d, 0, 14}] // Flatten (* Jean-François Alcover, Dec 09 2013, translated from Maple *)

A099952 Number of Wilf classes in S_n.

Original entry on oeis.org

1, 1, 1, 3, 16, 91, 595
Offset: 1

Views

Author

N. J. A. Sloane, Nov 12 2004

Keywords

References

  • Z. Stankova and J. West, A new class of Wilf-equivalent permutations, J. Algeb. Combin., 15 (2002), 271-290.

Crossrefs

Representatives for the three Wilf classes in S_4 are A005802, A022558, A061552. - N. J. A. Sloane, Mar 15 2015
Representatives for the 16 Wilf-equivalence patterns of length 5 are given in A116485, A047889, and A256195-A256208. - N. J. A. Sloane, Mar 19 2015

A022558 Number of permutations of length n avoiding the pattern 1342.

Original entry on oeis.org

1, 1, 2, 6, 23, 103, 512, 2740, 15485, 91245, 555662, 3475090, 22214707, 144640291, 956560748, 6411521056, 43478151737, 297864793993, 2059159989914, 14350039389022, 100726680316559, 711630547589023, 5057282786190872, 36132861123763276, 259423620328055093
Offset: 0

Views

Author

Keywords

Comments

Differs from A117156 which counts permutations avoiding the *consecutive* pattern 1342. - Ray Chandler, Dec 06 2011
Also, number of permutation of length n avoiding the pattern 3142 (see Stankova (1994) below). - Alexander Burstein, Aug 09 2013
Conjecture: a(n) is the number of permutations of length n simultaneously avoiding patterns 2143 and 415263. - Alexander Burstein, Mar 21 2019

Examples

			a(4) = 23 because obviously all permutations of length 4 with the exception of 1342 avoid 1342.
		

References

  • Miklos Bona, editor, Handbook of Enumerative Combinatorics, CRC Press, 2015, page 768, Th. 12.1.14.
  • R. P. Stanley, Enumerative Combinatorics, Cambridge, Vol. 2, 1999; see Problem 6.48.

Crossrefs

Essentially the same as A004040.
Cf. A117158.
A005802, A022558, A061552 are representatives for the three Wilf classes for length-four avoiding permutations (cf. A099952).

Programs

  • Maple
    a := proc (n) options operator, arrow: (1/2)*(-1)^(n-1)*(7*n^2-3*n-2)+3*(sum((-1)^(n-i)*2^(i+1)*factorial(2*i-4)*binomial(n-i+2, 2)/(factorial(i)*factorial(i-2)), i = 2 .. n)) end proc: seq(a(n), n = 0 .. 30); # Emeric Deutsch, Oct 15 2014
  • Mathematica
    Table[SeriesCoefficient[32*x/(1+20*x-8*x^2-(1-8*x)^(3/2)),{x,0,n}],{n,0,20}] (* Vaclav Kotesovec, Oct 07 2012 *)
    Table[1/2*(-1)^(n-1) * (-2-3*n+7*n^2) + 1/4*(-1)^n * (1+n) * (-2-13*n+(n+2) * Hypergeometric2F1[-3/2,-n,-2-n,-8]),{n,0,20}] (* Vaclav Kotesovec, Aug 24 2014 *)
  • PARI
    x='x+O('x^66); Vec( 32*x/(1+20*x-8*x^2-(1-8*x)^(3/2)) ) \\ Joerg Arndt, May 04 2013

Formula

a(n) = (7*n^2-3*n-2)/2 * (-1)^(n-1) + 3*Sum_{i=2..n} 2^(i+1) * (2*i-4)!/(i!*(i-2)!) * binomial(n-i+2, 2) * (-1)^(n-i).
G.f.: 32*x/(1 + 20*x - 8*x^2 - (1 - 8*x)^(3/2)). - Emeric Deutsch, Mar 13 2004
Recurrence: n*a(n) = (7*n-22)*a(n-1) + 4*(2*n-1)*a(n-2). - Vaclav Kotesovec, Oct 07 2012
a(n) ~ 2^(3*n+6)/(243*sqrt(Pi)*n^(5/2)). - Vaclav Kotesovec, Oct 07 2012

Extensions

Minor edits by Vaclav Kotesovec, Aug 24 2014

A039963 The period-doubling sequence A035263 repeated.

Original entry on oeis.org

1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1
Offset: 0

Views

Author

Keywords

Comments

An example of a d-perfect sequence.
Motzkin numbers mod 2. - Benoit Cloitre, Mar 23 2004
Let {a, b, c, c, a, b, a, b, a, b, c, c, a, b, ...} be the fixed point of the morphism: a -> ab, b -> cc, c -> ab, starting from a; then the sequence is obtained by taking a = 1, b = 1, c = 0. - Philippe Deléham, Mar 28 2004
The asymptotic mean of this sequence is 2/3 (Rowland and Yassawi, 2015; Burns, 2016). - Amiram Eldar, Jan 30 2021
The Gilbreath transform of floor(log_2(n)) (A000523). - Thomas Scheuerle, Sep 02 2024

Crossrefs

Motzkin numbers A001006 read mod 2,3,4,5,6,7,8,11: A039963, A039964, A299919, A258712, A299920, A258711, A299918, A258710.

Programs

  • Mathematica
    Flatten[ Nest[ Function[l, {Flatten[(l /. {a -> {a, b}, b -> {c, c}, c -> {a, b}})]}], {a}, 7] /. {a -> {1}, b -> {1}, c -> {0}}] (* Robert G. Wilson v, Feb 26 2005 *)
  • PARI
    A039963(n) = 1 - valuation(n\2+1,2)%2; \\ Max Alekseyev, Oct 23 2021
    
  • Python
    def A039963(n): return ((m:=(n>>1)+1)&-m).bit_length()&1 # Chai Wah Wu, Jan 09 2023

Formula

a(n) = A035263(1+floor(n/2)). - Benoit Cloitre, Mar 23 2004
a(n) = A040039(n) mod 2 = A002212(n+1) mod 2. a(0) = a(1) = 1, for n>=2: a(n) = ( a(n) + Sum_{k=0..n-2} a(k)*a(n-2-k)) mod 2. - Philippe Deléham, Mar 26 2004
a(n) = (A(n+2) - A(n)) mod 2, for A = A019300, A001285, A010060, A010059, A000069, A001969. - Philippe Deléham, Mar 28 2004
a(n) = A001006(n) mod 2. - Christian G. Bower, Jun 12 2005
a(n) = (-1)^n*(A096268(n+1) - A096268(n)). - Johannes W. Meijer, Feb 02 2013
a(n) = 1 - A007814(floor(n/2)+1) mod 2 = A005802(n) mod 2. - Max Alekseyev, Oct 23 2021

Extensions

More terms from Christian G. Bower, Jun 12 2005
Edited by N. J. A. Sloane at the suggestion of Andrew S. Plewe and Ralf Stephan, Jul 13 2007

A061552 Number of 1324-avoiding permutations of length n.

Original entry on oeis.org

1, 1, 2, 6, 23, 103, 513, 2762, 15793, 94776, 591950, 3824112, 25431452, 173453058, 1209639642, 8604450011, 62300851632, 458374397312, 3421888118907, 25887131596018, 198244731603623, 1535346218316422, 12015325816028313, 94944352095728825, 757046484552152932, 6087537591051072864
Offset: 0

Views

Author

Darko Marinov (marinov(AT)lcs.mit.edu), May 17 2001

Keywords

Examples

			a(4)=23 because all 24 permutations of length 4, except 1324 itself, avoid the pattern 1324.
		

References

  • Miklós Bóna, Combinatorics of Permutations. Discrete Mathematics and its Applications (Boca Raton), 2nd edn. CRC Press, Boca Raton (2012).

Crossrefs

A005802, A022558, A061552 are representatives for the three Wilf classes for length-four avoiding permutations (cf. A099952).

Programs

  • Maple
    count1324 := proc(n::nonnegint) if (n<4) then return n!; fi; if (n=4) then return 23; fi; return nodes([5,5,5,5], n-5) + nodes([5,3,5,5], n-5) + nodes([5,4,4,5], n-5) + nodes([5,5,4,5], n-5) + nodes([4,3,4], n-5) + nodes([5,3,4,5], n-5); end:
    nodes := proc(p, h) option remember; local i, j, s, l; if (h=0) then return convert(p, `+`); fi; s := 0; for j to nops(p) do l := p[j]+1; for i from 2 to j do l := l, `min`(j+1, p[i]); od; for i from j+1 to p[j] do l := l, p[i-1]+1; od; s := s+nodes([l], h-1); od; return s; end:
  • Mathematica
    a[n_] := n!/;n<4; a[4]=23; a[n_] := Total[nodes[#,n-5]&/@{{4,3,4},{5,3,4,5},{5,3,5,5},{5,4,4,5},{5,5,4,5},{5,5,5,5}}]; nodes[p_,0]:=Total[p]; nodes[p_,h_] := nodes[p,h] = Sum[nodes[Join[{p[[j]]+1}, Min[j+1,#]&/@p[[2;;j]], p[[j;;p[[j]]-1]]+1],h-1], {j,Length[p]}]; Array[a,12] (* David Bevan, May 25 2012 *)

Extensions

More terms from Vincent Vatter, Feb 26 2005
a(23)-a(25) added from the Albert et al. paper by N. J. A. Sloane, Mar 29 2013

A047890 Number of permutations in S_n with longest increasing subsequence of length <= 5.

Original entry on oeis.org

1, 1, 2, 6, 24, 120, 719, 5003, 39429, 344837, 3291590, 33835114, 370531683, 4285711539, 51990339068, 657723056000, 8636422912277, 117241501095189, 1639974912709122, 23570308719710838, 347217077020664880, 5231433025400049936, 80466744544235325387
Offset: 0

Views

Author

Eric Rains (rains(AT)caltech.edu), N. J. A. Sloane

Keywords

Crossrefs

A column of A047888. Cf. A005802, A052399.
Column k=5 of A214015.

Programs

  • Maple
    h:= proc(l) local n; n:=nops(l); add(i, i=l)! /mul(mul(1+l[i]-j
          +add(`if`(l[k]>=j, 1, 0), k=i+1..n), j=1..l[i]), i=1..n)
        end:
    g:= proc(n, i, l)
          `if`(n=0 or i=1, h([l[], 1$n])^2, `if`(i<1, 0,
           add(g(n-i*j, i-1, [l[], i$j]), j=0..n/i)))
        end:
    a:= n-> g(n, 5, []):
    seq(a(n), n=0..30);  # Alois P. Heinz, Apr 10 2012
    # second Maple program
    a:= proc(n) option remember; `if`(n<6, n!, ((-375+400*n+843*n^2
           +322*n^3+35*n^4)*a(n-1) +225*(n-1)^2*(n-2)^2*a(n-3)
           -(259*n^2+622*n+45)*(n-1)^2*a(n-2))/ ((n+6)^2*(n+4)^2))
        end:
    seq(a(n), n=0..30);  # Alois P. Heinz, Sep 26 2012
  • Mathematica
    h[l_] := With[{n = Length[l]}, Sum[i, {i, l}]!/Product[Product[1+l[[i]]-j+Sum[If[l[[k]] >= j, 1, 0], {k, i+1, n}], {j, 1, l[[i]]}], {i, 1, n}]]; g[n_, i_, l_] := If[n == 0 || i == 1, h[Join[l, Array[1&, n]]]^2, If[i<1, 0, Sum[g[n-i*j, i-1, Join[l, Array[i&, j]]], {j, 0, n/i}]]]; a[n_, k_] := If[k >= n, n!, g[n, k, {}]]; Table[a[n, 5], {n, 1, 30}] (* Jean-François Alcover, Mar 10 2014, after Alois P. Heinz *)

Formula

a(n) ~ 9 * 5^(2*n + 25/2) / (512 * n^12 * Pi^2). - Vaclav Kotesovec, Sep 10 2014

Extensions

More terms from Naohiro Nomoto, Mar 01 2002
More terms from Alois P. Heinz, Apr 10 2012

A052399 Number of permutations in S_n with longest increasing subsequence of length <= 6.

Original entry on oeis.org

1, 1, 2, 6, 24, 120, 720, 5039, 40270, 361302, 3587916, 38957991, 457647966, 5763075506, 77182248916, 1091842643475, 16219884281650, 251774983140578, 4066273930979460, 68077194367392864, 1177729684507324152, 20995515989327134152, 384762410996641402384
Offset: 0

Views

Author

N. J. A. Sloane, Mar 13 2000

Keywords

Comments

Previous name was: Related to Young tableaux of bounded height.

Crossrefs

Column k=6 of A214015.

Programs

  • Maple
    h:= proc(l) local n; n:=nops(l); add(i, i=l)! /mul(mul(1+l[i]-j
           +add(`if`(l[k]>=j, 1, 0), k=i+1..n), j=1..l[i]), i=1..n)
        end:
    g:= proc(n, i, l) option remember;
          `if`(n=0, h(l)^2, `if`(i<1, 0, `if`(i=1, h([l[], 1$n])^2,
           g(n, i-1, l)+ `if`(i>n, 0, g(n-i, i, [l[], i])))))
        end:
    a:= n-> g(n, 6, []):
    seq(a(n), n=0..25); # Alois P. Heinz, Apr 10 2012
    # second Maple program
    a:= proc(n) option remember; `if`(n<7, n!,
          ((56*n^5-9408+11032*n+19028*n^2+7360*n^3+1092*n^4)*a(n-1)
           -4*(196*n^3+1608*n^2+3167*n+444)*(n-1)^2*a(n-2)
           +1152*(2*n+3)*(n-1)^2*(n-2)^2*a(n-3))/ ((n+9)*(n+8)^2*(n+5)^2))
        end:
    seq(a(n), n=0..30);  # Alois P. Heinz, Sep 26 2012
  • Mathematica
    h[l_] := With[{n = Length[l]}, Sum[i, {i, l}]!/Product[Product[1+l[[i]]-j+Sum[If[l[[k]] >= j, 1, 0], {k, i+1, n}], {j, 1, l[[i]]}], {i, 1, n}]]; g[n_, i_, l_] := If[n == 0 || i == 1, h[Join[l, Array[1&, n]]]^2, If[i<1, 0, Sum[g[n-i*j, i-1, Join[l, Array[i&, j]]], {j, 0, n/i}]]]; a[n_, k_] := If[k >= n, n!, g[n, k, {}]]; Table[a[n, 6], {n, 0, 30}] (* Jean-François Alcover, Mar 11 2014, after Alois P. Heinz *)

Formula

a(n) ~ 5 * 2^(2*n + 6) * 3^(2*n + 21) / (n^(35/2) * Pi^(5/2)). - Vaclav Kotesovec, Sep 10 2014

Extensions

More terms from Alois P. Heinz, Apr 10 2012
New name from Vaclav Kotesovec, Sep 10 2014
Showing 1-10 of 36 results. Next