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

A005169 Number of fountains of n coins.

Original entry on oeis.org

1, 1, 1, 2, 3, 5, 9, 15, 26, 45, 78, 135, 234, 406, 704, 1222, 2120, 3679, 6385, 11081, 19232, 33379, 57933, 100550, 174519, 302903, 525734, 912493, 1583775, 2748893, 4771144, 8281088, 14373165, 24946955, 43299485, 75153286, 130440740, 226401112, 392955956, 682038999, 1183789679, 2054659669, 3566196321, 6189714276
Offset: 0

Views

Author

Keywords

Comments

A fountain is formed by starting with a row of coins, then stacking additional coins on top so that each new coin touches two in the previous row.
Also the number of Dyck paths for which the sum of the heights of the vertices that terminate an upstep (i.e., peaks and doublerises) is n. Example: a(4)=3 because we have UDUUDD, UUDDUD and UDUDUDUD. - Emeric Deutsch, Mar 22 2008
Also the number of ordered trees with path length n (follows from previous comment via a standard bijection). - Emeric Deutsch, Mar 22 2008
Probably first studied by Jim Propp (unpublished).
Number of compositions of n with c(1) = 1 and c(i+1) <= c(i) + 1. (Slide each row right 1/2 step relative to the row below, and count the columns.) - Franklin T. Adams-Watters, Nov 24 2009
With the additional requirement for weak unimodality one obtains A001524. - Joerg Arndt, Dec 09 2012

Examples

			An example of a fountain with 19 coins:
... O . O O
.. O O O O O O . O
. O O O O O O O O O
From _Peter Bala_, Dec 26 2012: (Start)
F(1/10) = Sum_{n >= 0} a(n)/10^n has the simple continued fraction expansion 1 + 1/(8 + 1/(1 + 1/(8 + 1/(1 + 1/(98 + 1/(1 + 1/(98 + 1/(1 + 1/(998 + 1/(1 + 1/(998 + 1/(1 + ...)))))))))))).
F(-1/10) = Sum_{n >= 0} (-1)^n*a(n)/10^n has the simple continued fraction expansion 1/(1 + 1/(9 + 1/(1 + 1/(9 + 1/(99 + 1/(1 + 1/(99 + 1/(999 + 1/(1 + 1/(999 + 1/(9999 + 1/(1 + ...)))))))))))).
(End)
		

References

  • S. R. Finch, Mathematical Constants, Cambridge, 2003, p. 381.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A001524, A192728, A192729, A192730, A111317, A143951, A285903, A226999 (inverse Euler transform), A291148 (convolution inverse).
First column of A168396. - Franklin T. Adams-Watters, Nov 24 2009
Diagonal of A185646.
Row sums of A047998. Column sums of A138158. - Emeric Deutsch, Mar 22 2008

Programs

  • Haskell
    a005169 0 = 1
    a005169 n = a168396 n 1  -- Reinhard Zumkeller, Sep 13 2013; corrected by R. J. Mathar, Sep 16 2013
  • Maple
    P[0]:=1: for n to 40 do P[n]:=sort(expand(t*(sum(P[j]*P[n-j-1]*t^(n-j-1),j= 0..n-1)))) end do: F:=sort(sum(P[k],k=0..40)): seq(coeff(F,t,j),j=0..36); # Emeric Deutsch, Mar 22 2008
    # second Maple program:
    A005169_G:= proc(x,NK); Digits:=250; Q2:=1;
            for k from NK by -1 to 0 do  Q1:=1-x^k/Q2; Q2:=Q1; od;
            Q3:=Q2; S:=1-Q3;
    end:
    series(A005169_G(x, 20), x, 21); # Sergei N. Gladkovskii, Dec 18 2011
  • Mathematica
    m = 36; p[0] = 1; p[n_] := p[n] = Expand[t*Sum[p[j]*p[n-j-1]*t^(n-j-1), {j, 0, n-1}]]; f[t_] = Sum[p[k], {k, 0, m}]; CoefficientList[Series[f[t], {t, 0, m}], t] (* Jean-François Alcover, Jun 21 2011, after Emeric Deutsch *)
    max = 43; Series[1-Fold[Function[1-x^#2/#1], 1, Range[max, 0, -1]], {x, 0, max}] // CoefficientList[#, x]& (* Jean-François Alcover, Sep 16 2014 *)
    b[n_, i_] := b[n, i] = If[n==0, 1, Sum[b[n-j, j], {j, 1, Min[i+1, n]}]];
    c[n_] :=  b[n, 0] - b[n-1, 0];
    c /@ Range[0, 50] // Accumulate  (* Jean-François Alcover, Nov 14 2020, after Alois P. Heinz in A289080 *)
  • PARI
    /* using the g.f. from p. L1278 of the Glasser, Privman, Svrakic paper */
    N=30;  x='x+O('x^N);
    P(k)=sum(n=0,N, (-1)^n*x^(n*(n+1+k))/prod(j=1,n,1-x^j));
    G=1+x*P(1)/( (1-x)*P(1)-x^2*P(2) );
    Vec(G) /* Joerg Arndt, Feb 10 2011 */
    
  • PARI
    /* As a continued fraction: */
    {a(n)=local(A=1+x,CF);CF=1+x;for(k=0,n,CF=1/(1-x^(n-k+1)*CF+x*O(x^n));A=CF);polcoeff(A,n)} /* Paul D. Hanna */
    
  • PARI
    /* By the Rogers-Ramanujan continued fraction identity: */
    {a(n)=local(A=1+x,P,Q);
    P=sum(m=0,sqrtint(n),(-1)^m*x^(m*(m+1))/prod(k=1,m,1-x^k));
    Q=sum(m=0,sqrtint(n),(-1)^m*x^(m^2)/prod(k=1,m,1-x^k));
    A=P/(Q+x*O(x^n));polcoeff(A,n)}  /* Paul D. Hanna */
    

Formula

A005169(n) = f(n, 1), where f(n, p) = 0 if p > n, 1 if p = n, Sum(1 <= q <= p+1; f(n-p, q)) if p < n. f=A168396.
G.f.: F(t) = Sum_{k>=0} P[k], where P[0]=1, P[n] = t*Sum_{j= 0..n-1} P[j]*P[n-j-1]*t^(n-j-1) for n >= 1. - Emeric Deutsch, Mar 22 2008
G.f.: 1/(1-x/(1-x^2/(1-x^3/(1-x^4/(1-x^5/(...)))))) [given on the first page of the Odlyzko/Wilf reference]. - Joerg Arndt, Mar 08 2011
G.f.: 1/G(0), where G(k)= 1 - x^(k+1)/G(k+1); (continued fraction). - Sergei N. Gladkovskii, Jun 29 2013
G.f.: A(x) = P(x)/Q(x) where
P(x) = Sum_{n>=0} (-1)^n* x^(n*(n+1)) / Product_{k=1..n} (1-x^k),
Q(x) = Sum_{n>=0} (-1)^n* x^(n^2) / Product_{k=1..n} (1-x^k),
due to the Rogers-Ramanujan continued fraction identity. - Paul D. Hanna, Jul 08 2011
From Peter Bala, Dec 26 2012: (Start)
Let F(x) denote the o.g.f. of this sequence. For positive integer n >= 3, the real number F(1/n) has the simple continued fraction expansion 1 + 1/(n-2 + 1/(1 + 1/(n-2 + 1/(1 + 1/(n^2-2 + 1/(1 + 1/(n^2-2 + 1/(1 + ...)))))))), while for n >= 2, F(-1/n) has the simple continued fraction expansion 1/(1 + 1/(n-1 + 1/(1 + 1/(n-1 + 1/(n^2-1 + 1/(1 + 1/(n^2-1 + 1/(n^3-1 + 1/(1 + ...))))))))). Examples are given below. Cf. A111317 and A143951.
(End)
a(n) = c * x^(-n) + O((5/3)^n), where c = 0.312363324596741... and x = A347901 = 0.576148769142756... is the lowest root of the equation Q(x) = 0, Q(x) see above (Odlyzko & Wilf 1988). - Vaclav Kotesovec, Jul 18 2013, updated Sep 24 2020
G.f.: G(0), where G(k)= 1 - x^(k+1)/(x^(k+1) - 1/G(k+1) ); (continued fraction). - Sergei N. Gladkovskii, Aug 06 2013
G.f.: 1 - 1/x + 1/(x*W(0)), where W(k)= 1 - x^(2*k+2)/(1 - x^(2*k+1)/W(k+1) ); (continued fraction). - Sergei N. Gladkovskii, Aug 16 2013

Extensions

More terms from David W. Wilson, Apr 30 2001

A227543 Triangle defined by g.f. A(x,q) such that: A(x,q) = 1 + x*A(q*x,q)*A(x,q), as read by terms k=0..n*(n-1)/2 in rows n>=0.

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 1, 1, 1, 3, 3, 3, 2, 1, 1, 1, 4, 6, 7, 7, 5, 5, 3, 2, 1, 1, 1, 5, 10, 14, 17, 16, 16, 14, 11, 9, 7, 5, 3, 2, 1, 1, 1, 6, 15, 25, 35, 40, 43, 44, 40, 37, 32, 28, 22, 18, 13, 11, 7, 5, 3, 2, 1, 1, 1, 7, 21, 41, 65, 86, 102, 115, 118, 118, 113, 106, 96, 85, 73, 63, 53, 42, 34, 26, 20, 15, 11, 7, 5, 3, 2, 1, 1
Offset: 0

Views

Author

Paul D. Hanna, Jul 15 2013

Keywords

Comments

See related triangle A138158.
Row sums are the Catalan numbers (A000108), set q=1 in the g.f. to see this.
Antidiagonal sums equal A005169, the number of fountains of n coins.
The maximum in each row of the triangle is A274291. - Torsten Muetze, Nov 28 2018
The area between a Dyck path and the x-axis may be decomposed into unit area triangles of two types - up-triangles with vertices at the integer lattice points (x, y), (x+1, y+1) and (x+2, y) and down-triangles with vertices at the integer lattice points (x, y), (x-1, y+1) and (x+1, y+1). The table entry T(n,k) equals the number of Dyck paths of semilength n containing k down triangles. See the illustration in the Links section. Cf. A239927. - Peter Bala, Jul 11 2019
The row polynomials of this table are a q-analog of the Catalan numbers due to Carlitz and Riordan. For MacMahon's q-analog of the Catalan numbers see A129175. - Peter Bala, Feb 28 2023

Examples

			G.f.: A(x,q) = 1 + x*(1) + x^2*(1 + q) + x^3*(1 + 2*q + q^2 + q^3)
 + x^4*(1 + 3*q + 3*q^2 + 3*q^3 + 2*q^4 + q^5 + q^6)
 + x^5*(1 + 4*q + 6*q^2 + 7*q^3 + 7*q^4 + 5*q^5 + 5*q^6 + 3*q^7 + 2*q^8 + q^9 + q^10)
 + x^6*(1 + 5*q + 10*q^2 + 14*q^3 + 17*q^4 + 16*q^5 + 16*q^6 + 14*q^7 + 11*q^8 + 9*q^9 + 7*q^10 + 5*q^11 + 3*q^12 + 2*q^13 + q^14 + q^15) +...
where g.f.A(x,q) = Sum_{k=0..n*(n-1)/2, n>=0} T(n,k)*x^n*q^k
satisfies A(x,q) = 1 + x*A(q*x,q)*A(x,q).
This triangle of coefficients T(n,k) in A(x,q) begins:
 1;
 1;
 1, 1;
 1, 2, 1, 1;
 1, 3, 3, 3, 2, 1, 1;
 1, 4, 6, 7, 7, 5, 5, 3, 2, 1, 1;
 1, 5, 10, 14, 17, 16, 16, 14, 11, 9, 7, 5, 3, 2, 1, 1;
 1, 6, 15, 25, 35, 40, 43, 44, 40, 37, 32, 28, 22, 18, 13, 11, 7, 5, 3, 2, 1, 1;
 1, 7, 21, 41, 65, 86, 102, 115, 118, 118, 113, 106, 96, 85, 73, 63, 53, 42, 34, 26, 20, 15, 11, 7, 5, 3, 2, 1, 1;
 1, 8, 28, 63, 112, 167, 219, 268, 303, 326, 338, 338, 331, 314, 293, 268, 245, 215, 190, 162, 139, 116, 97, 77, 63, 48, 38, 28, 22, 15, 11, 7, 5, 3, 2, 1, 1; ...
		

Crossrefs

Programs

  • Mathematica
    T[n_, k_] := Module[{P, Q},
    P = Sum[q^(m^2) (-x)^m/Product[1-q^j, {j, 1, m}] + x O[x]^n, {m, 0, n}];
    Q = Sum[q^(m(m-1)) (-x)^m/Product[1-q^j, {j, 1, m}] + x O[x]^n, {m, 0, n}];
    SeriesCoefficient[P/Q, {x, 0, n}, {q, 0, k}]
    ];
    Table[T[n, k], {n, 0, 10}, {k, 0, n(n-1)/2}] // Flatten (* Jean-François Alcover, Jul 27 2018, from PARI *)
  • PARI
    /* From g.f. A(x,q) = 1 + x*A(q*x,q)*A(x,q): */
    {T(n, k)=local(A=1); for(i=1, n, A=1+x*subst(A, x, q*x)*A +x*O(x^n)); polcoeff(polcoeff(A, n, x), k, q)}
    for(n=0, 10, for(k=0, n*(n-1)/2, print1(T(n, k), ", ")); print(""))
    
  • PARI
    /* By Ramanujan's continued fraction identity: */
    {T(n,k)=local(P=1,Q=1);
    P=sum(m=0,n,q^(m^2)*(-x)^m/prod(k=1,m,1-q^k)+x*O(x^n));
    Q=sum(m=0,n,q^(m*(m-1))*(-x)^m/prod(k=1,m,1-q^k)+x*O(x^n));
    polcoeff(polcoeff(P/Q,n,x),k,q)}
    for(n=0, 10, for(k=0, n*(n-1)/2, print1(T(n, k), ", ")); print(""))
    
  • PARI
    P(x, n) =
    {
        if ( n<=1, return(1) );
        return( sum( i=0, n-1, P(x, i) * P(x, n-1 -i) * x^((i+1)*(n-1 -i)) ) );
    }
    for (n=0, 10, print( Vec( P(x, n) ) ) ); \\ Joerg Arndt, Jan 23 2024
    
  • PARI
    \\ faster with memoization:
    N=11;
    VP=vector(N+1);  VP[1] =VP[2] = 1;  \\ one-based; memoization
    P(n) = VP[n+1];
    for (n=2, N, VP[n+1] = sum( i=0, n-1, P(i) * P(n-1 -i) * x^((i+1)*(n-1-i)) ) );
    for (n=0, N, print( Vec( P(n) ) ) ); \\ Joerg Arndt, Jan 23 2024

Formula

G.f.: A(x,q) = 1/(1 - x/(1 - q*x/(1 - q^2*x/(1 - q^3*x/(1 - q^4*x/(1 -...)))))), a continued fraction.
G.f. satisfies: A(x,q) = P(x,q)/Q(x,q), where
P(x,q) = Sum_{n>=0} q^(n^2) * (-x)^n / Product_{k=1..n} (1-q^k),
Q(x,q) = Sum_{n>=0} q^(n*(n-1)) * (-x)^n / Product_{k=1..n} (1-q^k),
due to Ramanujan's continued fraction identity.
...
Sum_{k=0..n*(n-1)/2} T(n,k)*k = 2^(2*n-1) - C(2*n+1,n) + C(2*n-1,n-1) = A006419(n-1) for n>=1.
Logarithmic derivative of the g.f. A(x,q), wrt x, yields triangle A227532.
From Peter Bala, Jul 11 2019: (Start)
(n+1)th row polynomial R(n+1,q) = Sum_{k = 0..n} q^k*R(k,x)*R(n-k,q), with R(0,q) = 1.
1/A(q*x,q) is the generating function for the triangle A047998. (End)
Conjecture: b(n) = P(n, n) where b(n) is an integer sequence with g.f. B(x) = 1/(1 - f(0)*x/(1 - f(1)*x/(1 - f(2)*x/(1 - f(3)*x/(1 - f(4)*x/(1 -...)))))), P(n, k) = P(n-1, k) + f(n-k)*P(n, k-1) for 0 < k <= n with P(n, k) = 0 for k > n, P(n, 0) = 1 for n >= 0 and where f(n) is an arbitrary function. In fact for this sequence we have f(n) = q^n. - Mikhail Kurkov, Sep 26 2024

A239927 Triangle read by rows: T(n,k) is the number of Dyck paths of semilength k such that the area between the x-axis and the path is n (n>=0; 0<=k<=n).

Original entry on oeis.org

1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 2, 0, 1, 0, 0, 0, 0, 3, 0, 1, 0, 0, 0, 1, 0, 4, 0, 1, 0, 0, 0, 0, 3, 0, 5, 0, 1, 0, 0, 0, 1, 0, 6, 0, 6, 0, 1, 0, 0, 0, 0, 3, 0, 10, 0, 7, 0, 1, 0, 0, 0, 0, 0, 7, 0, 15, 0, 8, 0, 1, 0, 0, 0, 0, 2, 0, 14, 0, 21, 0, 9, 0, 1, 0, 0, 0, 0, 0, 7, 0, 25, 0, 28, 0, 10, 0, 1, 0, 0, 0, 0, 1, 0, 17, 0, 41, 0, 36, 0, 11, 0, 1
Offset: 0

Views

Author

Joerg Arndt, Mar 29 2014

Keywords

Comments

Triangle A129182 transposed.
Column sums give the Catalan numbers (A000108).
Row sums give A143951.
Sums along falling diagonals give A005169.
T(4n,2n) = A240008(n). - Alois P. Heinz, Mar 30 2014

Examples

			Triangle begins:
00:  1;
01:  0, 1;
02:  0, 0, 1;
03:  0, 0, 0, 1;
04:  0, 0, 1, 0, 1;
05:  0, 0, 0, 2, 0, 1;
06:  0, 0, 0, 0, 3, 0, 1;
07:  0, 0, 0, 1, 0, 4, 0, 1;
08:  0, 0, 0, 0, 3, 0, 5, 0, 1;
09:  0, 0, 0, 1, 0, 6, 0, 6, 0, 1;
10:  0, 0, 0, 0, 3, 0, 10, 0, 7, 0, 1;
11:  0, 0, 0, 0, 0, 7, 0, 15, 0, 8, 0, 1;
12:  0, 0, 0, 0, 2, 0, 14, 0, 21, 0, 9, 0, 1;
13:  0, 0, 0, 0, 0, 7, 0, 25, 0, 28, 0, 10, 0, 1;
14:  0, 0, 0, 0, 1, 0, 17, 0, 41, 0, 36, 0, 11, 0, 1;
15:  0, 0, 0, 0, 0, 5, 0, 35, 0, 63, 0, 45, 0, 12, 0, 1;
16:  0, 0, 0, 0, 1, 0, 16, 0, 65, 0, 92, 0, 55, 0, 13, 0, 1;
17:  0, 0, 0, 0, 0, 5, 0, 40, 0, 112, 0, 129, 0, 66, 0, 14, 0, 1;
18:  0, 0, 0, 0, 0, 0, 16, 0, 86, 0, 182, 0, 175, 0, 78, 0, 15, 0, 1;
19:  0, 0, 0, 0, 0, 3, 0, 43, 0, 167, 0, 282, 0, 231, 0, 91, 0, 16, 0, 1;
20:  0, 0, 0, 0, 0, 0, 14, 0, 102, 0, 301, 0, 420, 0, 298, 0, 105, 0, 17, 0, 1;
...
Column k=4 corresponds to the following 14 paths (dots denote zeros):
#:         path              area   steps (Dyck word)
01:  [ . 1 . 1 . 1 . 1 . ]     4     + - + - + - + -
02:  [ . 1 . 1 . 1 2 1 . ]     6     + - + - + + - -
03:  [ . 1 . 1 2 1 . 1 . ]     6     + - + + - - + -
04:  [ . 1 . 1 2 1 2 1 . ]     8     + - + + - + - -
05:  [ . 1 . 1 2 3 2 1 . ]    10     + - + + + - - -
06:  [ . 1 2 1 . 1 . 1 . ]     6     + + - - + - + -
07:  [ . 1 2 1 . 1 2 1 . ]     8     + + - - + + - -
08:  [ . 1 2 1 2 1 . 1 . ]     8     + + - + - - + -
09:  [ . 1 2 1 2 1 2 1 . ]    10     + + - + - + - -
10:  [ . 1 2 1 2 3 2 1 . ]    12     + + - + + - - -
11:  [ . 1 2 3 2 1 . 1 . ]    10     + + + - - - + -
12:  [ . 1 2 3 2 1 2 1 . ]    12     + + + - - + - -
13:  [ . 1 2 3 2 3 2 1 . ]    14     + + + - + - - -
14:  [ . 1 2 3 4 3 2 1 . ]    16     + + + + - - - -
There are no paths with weight < 4, one with weight 4, none with weight 5, 3 with weight 6, etc., therefore column k=4 is
[0, 0, 0, 0, 1, 0, 3, 0, 3, 0, 3, 0, 2, 0, 1, 0, 1, 0, 0, 0, ...].
Row n=8 is [0, 0, 0, 0, 3, 0, 5, 0, 1], the corresponding paths of weight=8 are:
Semilength 4:
  [ . 1 . 1 2 1 2 1 . ]
  [ . 1 2 1 . 1 2 1 . ]
  [ . 1 2 1 2 1 . 1 . ]
Semilength 6:
  [ . 1 . 1 . 1 . 1 . 1 2 1 . ]
  [ . 1 . 1 . 1 . 1 2 1 . 1 . ]
  [ . 1 . 1 . 1 2 1 . 1 . 1 . ]
  [ . 1 . 1 2 1 . 1 . 1 . 1 . ]
  [ . 1 2 1 . 1 . 1 . 1 . 1 . ]
Semilength 8:
  [ . 1 . 1 . 1 . 1 . 1 . 1 . 1 . 1 . ]
		

Crossrefs

Sequences obtained by particular choices for x and y in the g.f. F(x,y) are: A000108 (F(1, x)), A143951 (F(x, 1)), A005169 (F(sqrt(x), sqrt(x))), A227310 (1+x*F(x, x^2), also 2-1/F(x, 1)), A239928 (F(x^2, x)), A052709 (x*F(1,x+x^2)), A125305 (F(1, x+x^3)), A002212 (F(1, x/(1-x))).
Cf. A129181.

Programs

  • Maple
    b:= proc(x, y, k) option remember;
          `if`(y<0 or y>x or k<0, 0, `if`(x=0, `if`(k=0, 1, 0),
           b(x-1, y-1, k-y+1/2)+ b(x-1, y+1, k-y-1/2)))
        end:
    T:= (n, k)-> b(2*k, 0, n):
    seq(seq(T(n, k), k=0..n), n=0..20);  # Alois P. Heinz, Mar 29 2014
  • Mathematica
    b[x_, y_, k_] := b[x, y, k] = If[y<0 || y>x || k<0, 0, If[x == 0, If[k == 0, 1, 0], b[x-1, y-1, k-y+1/2] + b[x-1, y+1, k-y-1/2]]]; T[n_, k_] := b[2*k, 0, n]; Table[ Table[T[n, k], {k, 0, n}], {n, 0, 20}] // Flatten (* Jean-François Alcover, Feb 18 2015, after Alois P. Heinz *)
  • PARI
    rvec(V) = { V=Vec(V); my(n=#V); vector(n, j, V[n+1-j] ); }
    print_triangle(V)= { my( N=#V ); for(n=1, N, print( rvec( V[n]) ) ); }
    N=20; x='x+O('x^N);
    F(x,y, d=0)=if (d>N, 1, 1 / (1-x*y * F(x, x^2*y, d+1) ) );
    v= Vec( F(x,y) );
    print_triangle(v)

Formula

G.f.: F(x,y) satisfies F(x,y) = 1 / (1 - x*y * F(x, x^2*y) ).
G.f.: 1/(1 - y*x/(1 - y*x^3/(1 - y*x^5/(1 - y*x^7/(1 - y*x^9/( ... )))))).

A138158 Triangle read by rows: T(n,k) is the number of ordered trees with n edges and path length k; 0 <= k <= n(n+1)/2.

Original entry on oeis.org

1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 2, 1, 1, 0, 0, 0, 0, 1, 3, 3, 3, 2, 1, 1, 0, 0, 0, 0, 0, 1, 4, 6, 7, 7, 5, 5, 3, 2, 1, 1, 0, 0, 0, 0, 0, 0, 1, 5, 10, 14, 17, 16, 16, 14, 11, 9, 7, 5, 3, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 6, 15, 25, 35, 40, 43, 44, 40, 37, 32, 28, 22, 18, 13, 11, 7, 5, 3, 2, 1, 1
Offset: 0

Views

Author

Emeric Deutsch, Mar 21 2008

Keywords

Comments

T(n,k) is the number of Dyck paths of semilength n for which the sum of the heights of the vertices that terminate an upstep (i.e. peaks and doublerises) is k. Example: T(4,7)=3 because we have UUDUDUDD, UDUUUDDD and UUUDDDUD.
See related triangle A227543.
Row n contains 1+n(n+1)/2 terms.
The maximum in each row of the triangle is A274291. - Torsten Muetze, Nov 28 2018
It appears that for j = 0,1,...,n-1 the first j terms of the rows in reversed order are given by A000041(j), the partition numbers. - Geoffrey Critzer, Jul 14 2020

Examples

			T(2,2)=1 because /\ is the only ordered tree with 2 edges and path length 2.
Triangle starts
 1,
 0, 1,
 0, 0, 1, 1,
 0, 0, 0, 1, 2, 1, 1,
 0, 0, 0, 0, 1, 3, 3, 3, 2, 1, 1,
 0, 0, 0, 0, 0, 1, 4, 6, 7, 7, 5, 5, 3, 2, 1, 1,
 0, 0, 0, 0, 0, 0, 1, 5, 10, 14, 17, 16, 16, 14, 11, 9, 7, 5, 3, 2, 1, 1,
 0, 0, 0, 0, 0, 0, 0, 1, 6, 15, 25, 35, 40, 43, 44, 40, 37, 32, 28, 22, 18, 13, 11, 7, 5, 3, 2, 1, 1,
... [_Joerg Arndt_, Feb 21 2014]
		

Crossrefs

Programs

  • Maple
    P[0]:=1: for n to 7 do P[n]:=sort(expand(t*(sum(P[j]*P[n-j-1]*t^(n-j-1),j= 0.. n-1)))) end do: for n from 0 to 7 do seq(coeff(P[n], t, j),j=0..(1/2)*n*(n+1)) end do; # yields sequence in triangular form
  • Mathematica
    nmax = 7;
    P[0] = 1; P[n_] := P[n] = t*Sum[P[j]*P[n-j-1]*t^(n-j-1), {j, 0, n-1}];
    row[n_] := row[n] = CoefficientList[P[n] + O[t]^(n(n+1)/2 + 1), t];
    T[n_, k_] := row[n][[k+1]];
    Table[T[n, k], {n, 0, nmax}, {k, 0, n(n+1)/2}] // Flatten (* Jean-François Alcover, Jul 11 2018, from Maple *)
    nn = 10; f[z_, u_] := Sum[Sum[a[n, k] u^k z^n, {k, 0, Binomial[n, 2]}], {n, 1, nn}]; sol = SolveAlways[Series[0 == f[z, u] - z/(1 - f[u z, u]) , {z, 0, nn}], {z, u}];Level[Table[Table[a[n, k], {k, 0, Binomial[n, 2]}], {n, 1, nn}] /.
    sol, {2}] // Grid (* Geoffrey Critzer, Jul 14 2020 *)

Formula

G.f. G(t,z) satisfies G(t,z) = 1+t*z*G(t,z)*G(t,t*z).
Row generating polynomials P[n]=P[n](t) are given by P[0]=1, P[n] = t * Sum( P[j]*P[n-j-1]*t^(n-1-j), j=0..n-1 ) (n>=1).
Row sums are the Catalan numbers (A000108).
Sum of entries in column n = A005169(n).
Sum_{k=0..n(n+1)/2} k*T(n,k) = A000346(n-1).
T(n,k) = A047998(k,n).
G.f.: 1/(1 - x*y/(1 - x*y^2/(1 - x*y^3/(1 - x*y^4/(1 - x*y^5)/(1 - ... ))))), a continued fraction. - Ilya Gutkovskiy, Apr 21 2017

A326453 Triangle read by rows: T(n,k) is the number of small Schröder paths of semilength k such that the area between the path and the x-axis is equal to n (n >= 0; 0 <= k <= n).

Original entry on oeis.org

1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 2, 1, 0, 0, 0, 3, 3, 1, 0, 0, 0, 2, 6, 4, 1, 0, 0, 0, 1, 7, 10, 5, 1, 0, 0, 0, 1, 6, 16, 15, 6, 1, 0, 0, 0, 1, 5, 19, 30, 21, 7, 1, 0, 0, 0, 0, 5, 19, 45, 50, 28, 8, 1, 0, 0, 0, 0, 4, 19, 55, 90, 77, 36, 9, 1, 3, 19, 61, 131, 161, 112, 45, 10, 1
Offset: 0

Views

Author

Peter Bala, Jul 06 2019

Keywords

Comments

A239927 is the companion triangle for Dyck paths.
A Schröder path is a lattice path in the plane starting and ending on the x-axis, never going below the x-axis, using the steps (1,1) rise, (1,-1) fall or (2,0) flat. A small Schröder path is a Schröder path with no flat steps on the x-axis.
The area between a small Schröder path and the x-axis may be decomposed into a stack of unit area triangles; the triangles are of two types: up-triangles with vertices at the lattice points (x, y), (x+1, y+1) and (x+2, y) and down-triangles with vertices at the lattice points (x, y), (x-1, y+1) and (x+1, y+1). A small Schröder path of semilength k has k up-triangles in the bottom row of its stack. See the illustration in the Links section for an example. Thus an alternative description of the triangle entry T(n,k) is the number of n triangle stacks, in the sense of A224704, containing k up-triangles in the bottom row.

Examples

			Triangle begins
  n\k|  0    1   2    3    4    5    6    7   8    9
  --------------------------------------------------
   0 |  1
   1 |  0    1
   2 |  0    0   1
   3 |  0    0   1    1
   4 |  0    0   1    2    1
   5 |  0    0   0    3    3    1
   6 |  0    0   0    2    6    4    1
   7 |  0    0   0    1    7   10    5    1
   8 |  0    0   0    1    6   16   15    6   1
   9 |  0    0   0    1    5   19   30   21   7   1
   ...
Example of a stack of 10 up- and down-triangles with 5 up-triangles in the bottom row.
          /\  /\
         /__\/__\     __
        /\  /\  /\  /\  /\
       /__\/__\/__\/__\/__\
		

Crossrefs

Formula

O.g.f. as a continued fraction: A(q,u) = 1/(1 + u - (1 + q)*u/(1 + u - (1 + q^3)*u/(1 + u - (1 + q^5)*u/( (...) )))) = 1 + q*u + q^2*u^2 + q^3*(u^2 + u^3) + q^4*(u^2 + 2*u^3 + u^4) + ...(q marks the area, u marks the up- triangles in the bottom row).
Alternative forms: A(q,u) = 1/(1 - q*u/(1 - q^2*u - q^3*u/(1 - q^4*u/( (...) ))));
A(q,u) = 1/(1 - q*u/(1 - (q^2 + q^3)*u/(1 - q^5*u/(1 - (q^4 + q^7)*u/(1 - q^9*u/(1 - (q^6 + q^11)*u/(1 - q^13*u/( (...) )))))))).
O.g.f. as a ratio of q-series: N(q,u)/D(q,u), where N(q,u) = Sum_{n >= 0} (-1)^n*u^n*q^(2*n^2 + n)/( (1 - q^2)*(1 - q^4)*...*(1 - q^(2*n)) * (1 - u*q^2)*(1 - u*q^4)*...*(1 - u*q^(2*n)) ) and D(q,u) = Sum_{n >= 0} (-1)^n*u^n*q^(2*n^2 - n)/( (1 - q^2)*(1 - q^4)*...*(1 - q^(2*n)) * (1 - u*q^2)*(1 - u*q^4)*...*(1 - u*q^(2*n)) ).

A383253 Number of compositions of n with parts in standard order.

Original entry on oeis.org

1, 1, 1, 2, 3, 5, 9, 16, 29, 53, 98, 182, 340, 638, 1202, 2273, 4312, 8204, 15650, 29925, 57344, 110101, 211771, 407987, 787174, 1520851, 2942030, 5697842, 11046881, 21438881, 41645541, 80967881, 157547508, 306791828, 597847686, 1165828440, 2274890125
Offset: 0

Views

Author

John Tyler Rascoe, May 06 2025

Keywords

Comments

A composition with parts in standard order satisfies the condition that for any part p > 1, the part p - 1 has already appeared. All compositions of this kind have first part 1.

Examples

			a(6) = 9 counts: (1,1,1,1,1,1), (1,1,1,1,2), (1,1,1,2,1), (1,1,2,1,1), (1,2,1,1,1), (1,1,2,2), (1,2,1,2), (1,2,2,1), (1,2,3).
		

Crossrefs

Programs

  • Maple
    b:= proc(n, i) option remember; `if`(n=0, 1, add(
          b(n-j, max(i, j)), j=1..min(n, i+1)))
        end:
    a:= n-> b(n, 0):
    seq(a(n), n=0..36);  # Alois P. Heinz, May 08 2025
  • PARI
    A_x(N) = {my(x='x+O('x^(N+1))); Vec(1 + sum(i=1,(N/2)+1, x^(i*(i+1)/2)/prod(j=1,i, 1 - (x-x^(j+1))/(1-x))))}
    A_x(40)

Formula

G.f.: 1 + Sum_{i>0} x^(i*(i+1)/2) / Product_{j=1..i} 1 - (x - x^(j+1))/(1 - x).

A326676 Triangular array: T(n,k) equals the number of n triangle stacks of large Schröder type with k down-triangles in the bottom row of the stack.

Original entry on oeis.org

1, 0, 1, 0, 1, 1, 0, 0, 2, 1, 0, 0, 1, 3, 1, 0, 0, 1, 3, 4, 1, 0, 0, 1, 3, 6, 5, 1, 0, 0, 0, 4, 7, 10, 6, 1, 0, 0, 0, 3, 10, 14, 15, 7, 1, 0, 0, 0, 2, 11, 21, 25, 21, 8, 1, 0, 0, 0, 1, 10, 28, 40, 41, 28, 9, 1, 0, 0, 0, 1, 9, 31, 60, 71, 63, 36, 10, 1
Offset: 0

Views

Author

Peter Bala, Jul 17 2019

Keywords

Comments

We define two types of plane triangles of unit area - up-triangles with vertices at the lattice points (x, y), (x+1, y+1) and (x+2, y) and down-triangles with vertices at the lattice points (x, y), (x-1, y+1) and (x+1, y+1).
To construct a triangle stack of large Schröder type we start with a horizontal row of k contiguous down-triangles forming the base row of the stack. Subsequent rows of the stack are formed by placing up-triangles on some, all or none of the down-triangles of the previous row. In the spaces between pairs of adjacent up-triangles further down-triangles may be placed. For an example, see the illustration in the Links section. There is an obvious bijective correspondence between triangle stacks of large Schröder type with a base of k down-triangles and large Schröder paths of semilength k. For another version of this array see A129179.
For triangle stacks of small Schröder type, where the base row consists of contiguous up-triangles, see A224704.

Examples

			Triangle begins
   n\k  0  1   2   3   4   5   6   7   8   9  10
   - - - - - - - - - - - - - - - - - - - - - - -
   0 |  1
   1 |  0  1
   2 |  0  1   1
   3 |  0  0   2   1
   4 |  0  0   1   3   1
   5 |  0  0   1   3   4   1
   6 |  0  0   1   3   6   5   1
   7 |  0  0   0   4   7  10   6   1
   8 |  0  0   0   3  10  14  15   7   1
   9 |  0  0   0   2  11  21  25  21   8  1
  10 |  0  0   0   1  10  28  40  41  28  9  1
...
		

Crossrefs

Row sums A088352. Column sums A006318. Cf. A047998, A129179, A224704.

Formula

O.g.f. as a continued fraction: (q marks the area of the stack and b marks down-triangles in the base of the stack)
A(q,b) = 1/(1 - q*b - q^2*b/(1 - q^3*b - q^4*b/(1 - q^5*b - q^6*b/( (...) )))) = 1 + b*q + (b + b^2)*q^2 + (2*b^2 + b^3)*q^3 + (b^2 + 3*b^3 + b^4)*q^4 + ....
A(q,b) = 1/(1 - (q + q^2)*b/(1 - q^4*b/(1 - (q^3 + q^6)*b/(1 - q^8*b/(1 - (q^5 + q^10)*b/(1 - q^12*b/( (...) ))))))).
O.g.f. as a ratio of q-series: N(q,b)/D(q,b), where N(q,b) = Sum_{n >= 0} (-1)^n*q^(2*n^2+2*n)*b^n/( (Product_{k = 1..n} 1 - q^(2*k)) * (Product_{k = 1..n+1} 1 - q^(2*k-1)*b) ) and D(q,b) = Sum_{n >= 0} (-1)^n*q^(2*n^2)*b^n/( (Product_{k = 1..n} 1 - q^(2*k)) * (Product_{k = 1..n} 1 - q^(2*k-1)*b) ).

A058300 Number of ways of piling up n wine bottles above a row of n+1 bottles at ground level.

Original entry on oeis.org

1, 1, 1, 3, 7, 16, 43, 115, 303, 813, 2203, 5991, 16371, 44917, 123598, 340988, 942930, 2612735, 7252407, 20163046, 56136326, 156488946, 436739752, 1220157514, 3412116339, 9550192161, 26751643663, 74991516850, 210364915858, 590490257667, 1658484275955
Offset: 0

Views

Author

Roland Bacher, Dec 08 2000

Keywords

Comments

Related to the Catalan numbers (which count the ways of storing an arbitrary number of bottles above n bottles at ground level).
Related to fountains of n coins (A005169). [Joerg Arndt, Mar 18 2011]

Examples

			a(4) = 7: the seven possibilities are:
..............0.............0.........0...............0.........0............0
.0.0.0.0.....0.0.0.......0.0.0.......0.0...0.....0...0.0.......0.0.0......0.0.0
0.0.0.0.0.,.0.0.0.0.0.,.0.0.0.0.0.,.0.0.0.0.0.,.0.0.0.0.0.,.0.0.0.0.0,.0.0.0.0.0
		

References

  • R. P. Stanley, Enumerative Combinatorics (Volume 2); see Exercise 6.19(hhh).

Crossrefs

Cf. A047998.

Programs

  • Mathematica
    terms = 31; initialMax = 5; Clear[g]; g[max_] := g[max] = (Print["max = ", max]; f = 1/Fold[1 - y*x^#2/#1&, 1, Range[max] // Reverse]; b[n_, k_] := SeriesCoefficient[f, {x, 0, n}, {y, 0, k}]; b[0, 0] = 1; Clear[a]; a[n_] := a[n] = b[2n+1, n+1]; Array[a, terms, 0]); g[max = initialMax]; g[max = max+1]; While[g[max] != g[max-1], max = max+1]; A058300 = g[max] (* Jean-François Alcover, Oct 05 2017, after Alois P. Heinz's formula *)

Formula

Coefficient of w^(2*n+1)*z^(n+1) in the formal power series G(w, z) defined by G(w, z)=1+w*z*G(w, w*z).
a(n) = A047998(2n+1,n+1). - Alois P. Heinz, Jun 24 2015
a(n) ~ c * d^n / sqrt(n), where d = 2.8566122635122125634030051... and c = 0.19212135026441477122126... - Vaclav Kotesovec, Jul 17 2019

Extensions

More terms from Alois P. Heinz, Jun 24 2015

A187080 Triangle T(n,k) read by rows: fountains of n coins and height k.

Original entry on oeis.org

1, 0, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 2, 0, 0, 0, 1, 4, 0, 0, 0, 0, 1, 7, 1, 0, 0, 0, 0, 1, 12, 2, 0, 0, 0, 0, 0, 1, 20, 5, 0, 0, 0, 0, 0, 0, 1, 33, 11, 0, 0, 0, 0, 0, 0, 0, 1, 54, 22, 1, 0, 0, 0, 0, 0, 0, 0, 1, 88, 44, 2, 0, 0, 0, 0, 0, 0, 0, 0, 1, 143, 85, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 232, 161, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 376, 302, 25, 0, 0, 0
Offset: 0

Views

Author

Joerg Arndt, Mar 08 2011

Keywords

Comments

See A005169 for the definition of a "fountain of n coins". [John W. Layman, Mar 10 2011]

Examples

			Triangle begins:
1;
0,1;
0,1,0;
0,1,1,0;
0,1,2,0,0;
0,1,4,0,0,0;
0,1,7,1,0,0,0;
0,1,12,2,0,0,0,0;
0,1,20,5,0,0,0,0,0;
0,1,33,11,0,0,0,0,0,0;
0,1,54,22,1,0,0,0,0,0,0;
0,1,88,44,2,0,0,0,0,0,0,0;
0,1,143,85,5,0,0,0,0,0,0,0,0;
0,1,232,161,12,0,0,0,0,0,0,0,0,0;
0,1,376,302,25,0,0,0,0,0,0,0,0,0,0;
0,1,609,559,52,1,0,0,0,0,0,0,0,0,0,0;
0,1,986,1026,105,2,0,0,0,0,0,0,0,0,0,0,0;
0,1,1596,1870,207,5,0,0,0,0,0,0,0,0,0,0,0,0;
The 15 compositions corresponding to fountains of 7 coins are the following:
   #:    composition      height
   1:    [ 1 2 3 1 ]        3
   2:    [ 1 2 2 2 ]        2
   3:    [ 1 1 2 3 ]        3
   4:    [ 1 2 2 1 1 ]      2
   5:    [ 1 2 1 2 1 ]      2
   6:    [ 1 1 2 2 1 ]      2
   7:    [ 1 2 1 1 2 ]      2
   8:    [ 1 1 2 1 2 ]      2
   9:    [ 1 1 1 2 2 ]      2
  10:    [ 1 2 1 1 1 1 ]    2
  11:    [ 1 1 2 1 1 1 ]    2
  12:    [ 1 1 1 2 1 1 ]    2
  13:    [ 1 1 1 1 2 1 ]    2
  14:    [ 1 1 1 1 1 2 ]    2
  15:    [ 1 1 1 1 1 1 1 ]  1
  stats:  0 1 12 2 0 0 0 0
		

Crossrefs

Row sums give A005169 (fountains of n coins).
Cf. A047998, A187081 (sandpiles by height).

Programs

  • Mathematica
    b[n_, i_, h_] := b[n, i, h] = If[n == 0, x^h, Sum[b[n - j, j, Max[h, j]], {j, 1, Min[i + 1, n]}]];
    T[n_] := Table[Coefficient[#, x, i], {i, 0, n}]& @ b[n, 0, 0];
    Table[T[n], {n, 0, 25}] // Flatten (* Jean-François Alcover, May 31 2019, after Alois P. Heinz in A291878 *)

Formula

T(n,1) + T(n,2) = Fibonacci(n).

A291878 Triangle read by rows: T(n,k) = number of fountains of n coins and height k.

Original entry on oeis.org

1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 2, 0, 1, 4, 0, 1, 7, 1, 0, 1, 12, 2, 0, 1, 20, 5, 0, 1, 33, 11, 0, 1, 54, 22, 1, 0, 1, 88, 44, 2, 0, 1, 143, 85, 5, 0, 1, 232, 161, 12, 0, 1, 376, 302, 25, 0, 1, 609, 559, 52, 1, 0, 1, 986, 1026, 105, 2, 0, 1, 1596, 1870, 207, 5, 0, 1
Offset: 0

Views

Author

Seiichi Manyama, Sep 05 2017

Keywords

Comments

Same as A187080, with trailing zeros omitted.

Examples

			T(6, 1) = 1;
. O O O O O O .
-------------------------------------------------------
T(6, 2) = 7;
.. O O ......... O O ..... O . O ..
. O O O O ... O O O O ... O O O O .
.......................................................
.. O ............. O ............. O ............. O ..
. O O O O O ... O O O O O ... O O O O O ... O O O O O .
-------------------------------------------------------
T(6, 3) = 1;
... O ...
.. O O ..
. O O O .
-------------------------------------------------------
First few rows are:
  1;
  0,  1;
  0,  1;
  0,  1,   1;
  0,  1,   2;
  0,  1,   4;
  0,  1,   7,   1;
  0,  1,  12,   2;
  0,  1,  20,   5;
  0,  1,  33,  11;
  0,  1,  54,  22,  1;
  0,  1,  88,  44,  2;
		

Crossrefs

Row sums give A005169.
Columns 0-2 give A000007, A000012, A000071.

Programs

  • Maple
    b:= proc(n, i, h) option remember; `if`(n=0, x^h,
          add(b(n-j, j, max(h, j)), j=1..min(i+1, n)))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=0..degree(p)))(b(n, 0$2)):
    seq(T(n), n=0..30);  # Alois P. Heinz, Sep 05 2017
  • Mathematica
    b[n_, i_, h_] := b[n, i, h] = If[n == 0, x^h, Sum[b[n - j, j, Max[h, j]], {j, 1, Min[i + 1, n]}]];
    T[n_] := Table[Coefficient[#, x, i], {i, 0, Exponent[#, x]}]& @ b[n, 0, 0];
    Table[T[n], {n, 0, 30}] // Flatten (* Jean-François Alcover, May 31 2019, after Alois P. Heinz *)
  • Python
    from sympy.core.cache import cacheit
    from sympy import Symbol, Poly, flatten
    x=Symbol('x')
    @cacheit
    def b(n, i, h): return x**h if n==0 else sum([b(n - j, j, max(h, j)) for j in range(1, min(i + 1, n) + 1)])
    def T(n): return 1 if n==0 else Poly(b(n, 0, 0)).all_coeffs()[::-1]
    print(flatten(map(T, range(31)))) # Indranil Ghosh, Sep 06 2017
Showing 1-10 of 14 results. Next