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.

A186084 Triangle T(n,k) read by rows: number of 1-dimensional sandpiles (see A186085) with n grains and base length k.

Original entry on oeis.org

1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 2, 1, 0, 0, 0, 1, 3, 1, 0, 0, 0, 0, 3, 4, 1, 0, 0, 0, 0, 1, 6, 5, 1, 0, 0, 0, 0, 1, 4, 10, 6, 1, 0, 0, 0, 0, 0, 3, 10, 15, 7, 1, 0, 0, 0, 0, 0, 2, 8, 20, 21, 8, 1, 0, 0, 0, 0, 0, 1, 7, 19, 35, 28, 9, 1, 0, 0, 0, 0, 0, 0, 5, 18, 40, 56, 36, 10, 1, 0, 0, 0, 0, 0, 0, 3, 16, 41, 76, 84, 45, 11, 1, 0, 0, 0, 0, 0, 0, 1, 12, 41, 86, 133, 120, 55, 12, 1
Offset: 0

Views

Author

Joerg Arndt, Feb 13 2011

Keywords

Comments

Compositions of n into k nonzero parts such that the first and last parts are 1 and the absolute difference between consecutive parts is <=1.
Row sums are A186085.
Column sums are the Motzkin numbers (A001006).
First nonzero entry in row n appears in column A055086(n).
From Joerg Arndt, Nov 06 2012: (Start)
The transposed triangle (with zeros omitted) is A129181.
For large k, the columns end in reverse([1, 1, 3, 5, 9, 14, 24, 35, ...]) for k even (cf. A053993) and reverse([1, 2, 3, 6, 10, 16, 26, 40, 60, 90, ...]) for k odd (cf. A201077).
The diagonals below the main diagonal are (apart from leading zeros), n, n*(n+1)/2, n*(n+1)*(n+2)/6, and the e-th diagonal appears to have a g.f. of the form f(x)/(1-x)^e.
(End)

Examples

			Triangle begins:
1;
0,1;
0,0,1;
0,0,1,1;
0,0,0,2,1;
0,0,0,1,3,1;
0,0,0,0,3,4,1;
0,0,0,0,1,6,5,1;
0,0,0,0,1,4,10,6,1;
0,0,0,0,0,3,10,15,7,1;
0,0,0,0,0,2,8,20,21,8,1;
0,0,0,0,0,1,7,19,35,28,9,1;
		

Crossrefs

Cf. A186085 (sandpiles with n grains, row sums), A001006 (Motzkin numbers, column sums), A055086.
Cf. A186505 (antidiagonal sums).

Programs

  • Maple
    b:= proc(n, i) option remember; `if`(n=0, `if`(i=1, 1, 0),
          `if`(n<0 or i<1, 0, expand(x*add(b(n-i, i+j), j=-1..1)) ))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=0..degree(p)))(b(n, 1)):
    seq(T(n), n=0..20);  # Alois P. Heinz, Jul 24 2013
  • Mathematica
    b[n_, i_] := b[n, i] = If[n == 0, If[i == 1, 1, 0], If[n<0 || i<1, 0, Expand[ x*Sum[b[n-i, i+j], {j, -1, 1}]]]]; T[n_] := Function[{p}, Table[Coefficient[p, x, i], {i, 0, Exponent[p, x]}]][b[n, 1]]; Table[T[n], {n, 0, 20}] // Flatten (* Jean-François Alcover, Feb 18 2015, after Alois P. Heinz *)
  • PARI
    {T(n,k)=local(A=1+x*y);for(i=1,n,A=1/(1-x*y-x^3*y^2*subst(A,y,x*y+x*O(x^n))));polcoeff(polcoeff(A,n,x),k,y)}
    /* Paul D. Hanna */

Formula

G.f. A(x,y) satisfies: A(x,y) = 1/(1 - x*y - x^3*y^2*A(x, x*y) ). [Paul D. Hanna, Feb 22 2011]
G.f.: (formatting to make the structure apparent)
A(x,y) = 1 /
(1 - x^1*y / (1 - x^2*y / (1 - x^5*y^2 /
(1 - x^3*y / (1 - x^4*y / (1 - x^9*y^2 /
(1 - x^5*y / (1 - x^6*y / (1 - x^13*y^2 /
(1 - x^7*y / (1 - x^8*y / (1 - x^17*y^2 / (1 -...)))))))))))))
(continued fraction). [Paul D. Hanna]
G.f.: A(x,y) = 1/(1-x*y - x^3*y^2/(1-x^2*y - x^5*y^2/(1-x^3*y - x^7*y^2/(1 -...)))) (continued fraction). [Paul D. Hanna]