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

A186085 Number of 1-dimensional sandpiles with n grains.

Original entry on oeis.org

1, 1, 1, 1, 2, 3, 5, 8, 13, 22, 36, 60, 100, 166, 277, 461, 769, 1282, 2137, 3565, 5945, 9916, 16540, 27589, 46022, 76769, 128062, 213628, 356366, 594483, 991706, 1654352, 2759777, 4603843, 7680116, 12811951, 21372882, 35654237, 59478406, 99221923, 165522118, 276124217, 460630839
Offset: 0

Views

Author

Joerg Arndt, Feb 12 2011

Keywords

Comments

Number of compositions of n where the first and the last parts are 1 and the absolute difference between consecutive parts is <=1 (smooth compositions).
Such a composition [c1,c2,c3,...] corresponds to a sandpile with c1(=1) grains in the first positions, c2 in the second, and so on. Assuming the critical slope is 1 (for the pile to be stable) we obtain the conditions on the compositions.
With the additional requirement of unimodality one gets A001522. [Joerg Arndt, Dec 09 2012]
Dropping the requirement that the first and last parts are 1 gives A034297. Restriction to weakly increasing (or decreasing) sums gives A034296. [Joerg Arndt, Jun 02 2013]
Also the number of compositions of n with first part 1, up-steps of at most 1, and no two consecutive up-steps. The sandpiles are recovered by shifting the rows above the bottom row to the left by one position relative to the next lower row. [Joerg Arndt, Mar 30 2014]
Also fountains of coins (cf. A005169) with no consecutive up-steps. Shift the top rows in the previous comment by half a position. [Joerg Arndt, Mar 30 2014]

Examples

			The a(7)=8 smooth compositions of 7 are:
:   1:      [ 1 1 1 1 1 1 1 ]  (composition)
:
: ooooooo  (rendering of sandpile)
:
:   2:      [ 1 1 1 1 2 1 ]
:
:     o
: oooooo
:
:   3:      [ 1 1 1 2 1 1 ]
:
:    o
: oooooo
:
:   4:      [ 1 1 2 1 1 1 ]
:
:   o
: oooooo
:
:   5:      [ 1 1 2 2 1 ]
:
:   oo
: ooooo
:
:   6:      [ 1 2 1 1 1 1 ]
:
:  o
: oooooo
:
:   7:      [ 1 2 1 2 1 ]
:
:  o o
: ooooo
:
:   8:      [ 1 2 2 1 1 ]
:
:  oo
: ooooo
		

Crossrefs

Cf. A186084 (sandpiles by base length).
Cf. A005169 (compositions of n with c(1)=1 and c(i+1)<=c(i)+1).
Cf. A186505 (antidiagonal sums of triangle A186084).
Cf. A129181.

Programs

  • Maple
    b:= proc(n, i) option remember; `if`(n=0, `if`(i=1, 1, 0),
          `if`(n<0 or i<1, 0, add(b(n-i, i+j), j=-1..1)))
        end:
    a:= n-> `if`(n=0, 1, b(n-1, 1)):
    seq(a(n), n=0..50);  # Alois P. Heinz, Jun 11 2013
  • Mathematica
    b[n_, i_] := b[n, i] = If[n == 0, If[i == 1, 1, 0], If[n<0 || i<1, 0, Sum[b[n-i, i+j], {j, -1, 1}]]]; a[n_] := If[n == 0, 1, b[n-1, 1]]; Table[a[n], {n, 0, 50}] (* Jean-François Alcover, Feb 03 2014, after Alois P. Heinz *)
  • PARI
    {a(n)=local(Txy=1+x*y); for(i=1, n, Txy=1/(1-x*y-x^3*y^2*subst(Txy, y, x*y+x*O(x^n)))); polcoeff(subst(1+x*Txy, y, 1), n, x)} /* Paul D. Hanna */
    
  • PARI
    /* continued fraction for terms up to 460630839: */
    Vec(1/ (1-x/ (1-x^3/ (1-x^2/ (1-x^3/ (1-x^7/ (1-x^4/ (1-x^5/ (1-x^11/ (1-x^6/(1-x*O(x^0) ))))))))))) /* Paul D. Hanna */
    
  • PARI
    N = 66; x = 'x + O('x^N);
    Q(k) = if(k>N, 1, 1/x^(k+1) - 1 - 1/Q(k+1) );
    gf = 1 + 1/Q(0);
    Vec(gf) /* Joerg Arndt, May 07 2013 */

Formula

G.f.: 1 + x/(1-x - x^3*B(x)) where B(x) equals the g.f. of the antidiagonal sums of triangle A186084 [Paul D. Hanna].
G.f.: 1 + x/(1-x - x^3/(1-x^2 - x^5/(1-x^3 - x^7/(1-x^4 - x^9/(1 -...))))) (continued fraction). [Paul D. Hanna].
G.f.: 1/(1 - x/(1-x^3/(1-x^2/(1 - x^3/(1-x^7/(1-x^4/(1 - x^5/(1-x^11/(1-x^6/(1 -...)))))))))) (continued fraction). [Paul D. Hanna].
The g.f. T(x,y) of triangle A186084 satisfies: T(x,y) = 1/(1 - x*y - x^3*y^2*T(x,x*y)); therefore, the g.f. of this sequence is A(x) = 1 + x*T(x,1). [Paul D. Hanna]
a(n) ~ c/r^n where r = 0.5994477646147968266874606710272382... and c = 0.213259838728143595595398989847345... [Paul D. Hanna]
G.f.: 1 + 1/Q(0), where Q(k)= 1/x^(k+1) - 1 - 1/Q(k+1); (continued fraction). - Sergei N. Gladkovskii, May 07 2013
G.f.: G(1), where G(k) = 1 + x^k/( 1 - x^k * G(k+1) ) (continued fraction). [Joerg Arndt, Jun 29 2013]
a(n) = Sum_{j=1..n} A129181(n-j,j-1) for n>=1. - Alois P. Heinz, Jun 25 2023

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/( ... )))))).

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]

A201160 Irregular triangle read by rows: number of Motzkin paths of length n and rank k.

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 1, 1, 1, 3, 3, 1, 1, 2, 3, 4, 6, 4, 1, 1, 1, 3, 5, 7, 8, 10, 10, 5, 1, 1, 2, 3, 6, 8, 12, 16, 18, 19, 20, 15, 6, 1
Offset: 0

Views

Author

N. J. A. Sloane, Nov 27 2011

Keywords

Comments

This might be the row-reversed variant of A129181. - R. J. Mathar, Dec 13 2011

Examples

			Triangle begins
1
1
1 1
1 2 1
1 1 3 3 1
1 2 3 4 6 4 1
1 1 3 5 7 8 10 10 5 1
1 2 3 6 8 12 16 18 19 20 15 6 1
...
		
Showing 1-4 of 4 results.