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

A080934 Square array read by antidiagonals of number of Catalan paths (nonnegative, starting and ending at 0, step +/-1) of 2n steps with all values less than or equal to k.

Original entry on oeis.org

1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 2, 1, 0, 1, 1, 2, 4, 1, 0, 1, 1, 2, 5, 8, 1, 0, 1, 1, 2, 5, 13, 16, 1, 0, 1, 1, 2, 5, 14, 34, 32, 1, 0, 1, 1, 2, 5, 14, 41, 89, 64, 1, 0, 1, 1, 2, 5, 14, 42, 122, 233, 128, 1, 0, 1, 1, 2, 5, 14, 42, 131, 365, 610, 256, 1, 0, 1, 1, 2, 5, 14, 42, 132, 417, 1094, 1597, 512, 1, 0
Offset: 0

Views

Author

Henry Bottomley, Feb 25 2003

Keywords

Comments

Number of permutations in S_n avoiding both 132 and 123...k.
T(n,k) = number of rooted ordered trees on n nodes of depth <= k. Also, T(n,k) = number of {1,-1} sequences of length 2n summing to 0 with all partial sums are >=0 and <= k. Also, T(n,k) = number of closed walks of length 2n on a path of k nodes starting from (and ending at) a node of degree 1. - Mitch Harris, Mar 06 2004
Also T(n,k) = k-th coefficient in expansion of the rational function R(n), where R(1) = 1, R(n+1) = 1/(1-x*R(n)), which means also that lim(n->inf,R(n)) = g.f. of Catalan numbers (A000108) wherever it has real value (see Mansour article). - Clark Kimberling and Ralf Stephan, May 26 2004
Row n of the array gives Taylor series expansion of F_n(t)/F_{n+1}(t), where F_n(t) are the Fibonacci polynomials defined in A259475 [Kreweras, 1970]. - N. J. A. Sloane, Jul 03 2015

Examples

			T(3,2) = 4 since the paths of length 2*3 (7 points) with all values less than or equal to 2 can take the routes 0101010, 0101210, 0121010 or 0121210, but not 0123210.
From _Peter Luschny_, Aug 27 2014: (Start)
Trees with n nodes and height <= h:
h\n  1  2  3  4   5   6    7    8     9    10     11
---------------------------------------------------------
[ 1] 1, 0, 0, 0,  0,  0,   0,   0,    0,    0,     0, ...  A063524
[ 2] 1, 1, 1, 1,  1,  1,   1,   1,    1,    1,     1, ...  A000012
[ 3] 1, 1, 2, 4,  8, 16,  32,  64,  128,  256,   512, ...  A011782
[ 4] 1, 1, 2, 5, 13, 34,  89, 233,  610, 1597,  4181, ...  A001519
[ 5] 1, 1, 2, 5, 14, 41, 122, 365, 1094, 3281,  9842, ...  A124302
[ 6] 1, 1, 2, 5, 14, 42, 131, 417, 1341, 4334, 14041, ...  A080937
[ 7] 1, 1, 2, 5, 14, 42, 132, 428, 1416, 4744, 16016, ...  A024175
[ 8] 1, 1, 2, 5, 14, 42, 132, 429, 1429, 4846, 16645, ...  A080938
[ 9] 1, 1, 2, 5, 14, 42, 132, 429, 1430, 4861, 16778, ...  A033191
[10] 1, 1, 2, 5, 14, 42, 132, 429, 1430, 4862, 16795, ...  A211216
---------------------------------------------------------
The generating functions are listed in A211216. Note that the values up to the main diagonal are the Catalan numbers A000108.
(End)
		

Crossrefs

Cf. A000108, A079214, A080935, A080936. Rows include A000012, A057427, A040000 (offset), columns include (essentially) A000007, A000012, A011782, A001519, A007051, A080937, A024175, A080938, A033191, A211216. Main diagonal is A000108.
Cf. A094718 (involutions). Cf. also A259475.

Programs

  • Maple
    # As a triangular array:
    b:= proc(x, y, k) option remember; `if`(y>min(k, x) or y<0, 0,
          `if`(x=0, 1, b(x-1, y-1, k)+ b(x-1, y+1, k)))
        end:
    A:= (n, k)-> b(2*n, 0, k):
    seq(seq(A(n, d-n), n=0..d), d=0..12);  # Alois P. Heinz, Aug 06 2012
    # As a square array:
    A := proc(n,k) option remember; local j; if n = 1 then 1 elif k = 1 then 0 else add(A(n-j,k)*A(j,k-1), j=1..n-1) fi end:
    linalg[matrix](10, 12, (n,k) -> A(k,n)); # Peter Luschny, Aug 27 2014
  • Mathematica
    A[n_, k_] := A[n, k] = Which[n == 1, 1, k == 1, 0, True, Sum[A[n-j, k]*A[j, k-1], {j, 1, n-1}]]; Table[A[k-n+1, n], {k, 1, 13}, {n, k, 1, -1}] // Flatten (* Jean-François Alcover, Feb 19 2015, after Peter Luschny *)
  • PARI
    A(N, K) = {
      my(m = matrix(N, K, n, k, n==1));
      for (n = 2, N,
      for (k = 2, K,
           m[n,k] = sum(i = 1, n-1, m[n-i,k] * m[i,k-1])));
      return(m);
    }
    A(11,10)~  \\ Gheorghe Coserea, Jan 13 2016

Formula

T(n, k) = Sum_{0A080935(n, k) = T(n, k-1)+A080936(n, k); for k>=n T(n, k) = A000108(n).
T(n, k) = 2^(2n+1)/(k+2) * Sum_{i=1..k+1} (sin(Pi*i/(k+2))*cos(Pi*i/(k+2))^n)^2 for n>=1. - Herbert Kociemba, Apr 28 2004
G.f. of n-th row: B(n)/B(n+1) where B(j)=[(1+sqrt(1-4x))/2]^j-[(1-sqrt(1-4x))/2]^j.

A274969 Number of walks in the first quadrant starting and ending at (0,0) consisting of 3n steps taken from {E=(1, 0), D=(-1, 1), S=(0, -1)}, no S step occurring before the final E step.

Original entry on oeis.org

1, 1, 4, 21, 121, 728, 4488, 28101, 177859, 1134705, 7283640, 46981740, 304253964, 1976886616, 12880883408, 84130964709, 550649378199, 3610705776755, 23714554702020, 155979407872365, 1027269675638745, 6773476758296220, 44709685668953760, 295402076512228140, 1953492865541875476
Offset: 0

Views

Author

David Bevan, Jul 13 2016

Keywords

Comments

Number of pushall stack words of length 3n. These consist of n 'ρ' letters, n 'λ' letters and n 'μ' letters, such that the count of 'λ' letters never exceeds the count of 'ρ' letters, the count of 'μ' letters never exceeds the count of 'λ' letters, and all the 'ρ' letters occur before any of the 'μ' letters.
A permutation of length n is 2-stack pushall sortable if and only if it can be sorted by a sequence of 3n operations represented by a pushall stack word of length 3n, where ρ corresponds to pushing to the 1st (Right) stack, λ corresponds to popping from the 1st stack and pushing to the 2nd (Left) stack, and μ corresponds to popping from the 2nd stack.
There is an obvious bijection between pushall stack words of length 3n using the letters 'ρ', 'λ', and 'μ', and pushall stack words of length 3n in which 'ρ' and 'μ' are the same symbol. In this way, a(n) is the number of words consisting of n 'λ' letters and 2n 'μ' letters, such that the count of 'λ' letters never exceeds the count of 'μ' letters in any prefix or suffix of the word. This allows a closed form (added below) based on two usages of "Andre's reflection method", in analogy with the Catalan numbers. - Janis Stipins, May 27 2019

Examples

			For n=2, the four walks are EEDDSS, EEDSDS, EDEDSS and EDESDS.
		

Crossrefs

Walks in the first quadrant from (0,0) to (0,0) with steps from {E, D, S} A005789.
2-stack pushall sortable permutations A274970.
Cf. A259475.

Programs

  • Mathematica
    CoefficientList[Module[{r=0},Do[r+=Coefficient[1-16z+64z^2+(21z-96z^2)f+(-4z+27z^2)f^2+(-4z^2+27z^3)f^3/.f->r,z,i]z^i,{i,0,30}];r],z]
  • PARI
    N=O(z^35); f=1+N; while(f+N<>f=1+(5*z-32*z^2+(-4+27*z)*z*(1+z*f)*f^2)/(1-21*z+96*z^2), ); Vec(f+N) \\ Using that the g.f. is fixed point of T(f)=1+(5*z-32*z^2+(-4+27*z)*z*(1+z*f)*f^2)/(1-21*z+96*z^2). - M. F. Hasler, Jul 13 2016
    
  • PARI
    a(n) = binomial(3*n,n) - 2*binomial(3*n,n-1) + binomial(3*n,n-2); \\ Janis Stipins, May 27 2019

Formula

The o.g.f. f=f(z) is algebraic, satisfying the cubic equation (1-16*z+64*z^2) + (-1+21*z-96*z^2)*f + (-4*z+27*z^2)*f^2 + (-4*z^2+27*z^3)*f^3 = 0.
a(n) = A259475(n,n). - Alois P. Heinz, Nov 19 2018
a(n) = binomial(3*n,n) - 2*binomial(3*n,n-1) + binomial(3*n,n-2). - Janis Stipins, May 27 2019
G.f.: (2*(1 - 6*x)*cos(arccos(1 - (27*x)/2)/6)/sqrt(4 - 27*x) + 4*sqrt(3)*sqrt(x)*sin(arcsin(3*sqrt(3)*sqrt(x)/2)/3) - 1)/(3*x). - Stefano Spezia, Feb 19 2022

Extensions

Data double-checked by M. F. Hasler, Jul 13 2016
Showing 1-2 of 2 results.