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

A291896 Number of 1-dimensional sandpiles with n grains piling up against the wall.

Original entry on oeis.org

1, 1, 1, 2, 3, 5, 9, 14, 24, 40, 67, 112, 186, 312, 520, 868, 1449, 2417, 4034, 6730, 11229, 18735, 31254, 52143, 86989, 145119, 242096, 403871, 673751, 1123964, 1875014, 3127926, 5218034, 8704769, 14521354, 24224601, 40411595, 67414781, 112461579, 187608762
Offset: 0

Views

Author

Seiichi Manyama, Sep 05 2017

Keywords

Comments

Number of compositions of n where the first part is 1 and the absolute difference between consecutive parts is <=1 (smooth compositions).

Examples

			The a(6)=9 smooth compositions of 6 are:
:
: oooooo|
:
:     o|
: ooooo|
:
:    o |
: ooooo|
:
:   o  |
: ooooo|
:
:  o   |
: ooooo|
:
:   oo|
: oooo|
:
:  o o|
: oooo|
:
:  oo |
: oooo|
:
:   o|
:  oo|
: ooo|
		

Crossrefs

Programs

  • Maple
    b:= proc(n, i) option remember; `if`(n=0, 1,
          add(b(n-j, j), j=max(1, i-1)..min(i+1, n)))
        end:
    a:= n-> b(n, 0):
    seq(a(n), n=0..50);  # Alois P. Heinz, Sep 05 2017
  • Mathematica
    b[n_, i_] := b[n, i] = If[n==0, 1, Sum[b[n-j, j], {j, Max[1, i-1], Min[i+1, n]}]]; a[n_] := b[n, 0]; Table[a[n], {n, 0, 50}] (* Jean-François Alcover, May 29 2019, after Alois P. Heinz *)
  • Python
    from sympy.core.cache import cacheit
    @cacheit
    def b(n, i): return 1 if n==0 else sum(b(n - j, j) for j in range(max(1, i - 1), min(i + 1, n) + 1))
    def a(n): return b(n, 0)
    print([a(n) for n in range(51)]) # Indranil Ghosh, Sep 06 2017, after Maple code

A291904 Triangle read by rows: T(n,k) = T(n-k,k-1) + T(n-k,k+1) with T(0,0) = 1 for 0 <= k <= A003056(n).

Original entry on oeis.org

1, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, 1, 0, 0, 2, 1, 0, 0, 2, 1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 3, 2, 0, 0, 3, 2, 1, 1, 1, 0, 2, 3, 2, 1, 0, 0, 3, 4, 3, 1, 0, 0, 4, 4, 3, 2, 1, 0, 4, 6, 4, 2, 0, 0, 6, 7
Offset: 0

Views

Author

Seiichi Manyama, Sep 05 2017

Keywords

Comments

T(n,k) is the number of integer compositions of n with first part 1, last part k, and all adjacent differences in {-1,1}. - John Tyler Rascoe, Aug 14 2023

Examples

			First few rows are:
  1;
  0, 1;
  0, 0;
  0, 0, 1;
  0, 1, 0;
  0, 0, 0;
  0, 0, 1, 1;
  0, 1, 0, 0;
  0, 0, 1, 0;
  0, 1, 1, 1;
  0, 1, 0, 0, 1;
  0, 0, 2, 1, 0;
  0, 2, 1, 1, 0.
		

Crossrefs

Row sums give A291905.
Columns 0-1 give A000007, A227310 (for n>0).

Programs

  • Mathematica
    T[0, 0] = 1; T[, 0] = 0; T[n?Positive, k_] /; 0 < k <= Floor[(Sqrt[8n+1] - 1)/2] := T[n, k] = T[n-k, k-1] + T[n-k, k+1]; T[, ] = 0;
    Table[T[n, k], {n, 0, 20}, {k, 0, Floor[(Sqrt[8n+1] - 1)/2]}] // Flatten (* Jean-François Alcover, May 29 2019 *)

Formula

From John Tyler Rascoe, Aug 14 2023: (Start)
This triangle is T_1(n,k) of the general triangle T_m(n,k) for compositions of this kind with first part m.
T_m(n,k) for 0 < m, 0 <= n, and 0 <= k <= A003056(n+A000217(m-1)).
T_m(0,0) = T_m(m,m) = 1.
T_m(n,k) = T_m(n-k,k-1) + T_m(n-k,k+1) for m < n and 0 < k <= A003056(n+A000217(m-1)).
T_m(n,k) = 0 for 0 < n < m or n < k.
T_m(n,0) = 0 for 0 < n. (End)

A291929 Triangle read by rows: T(n,k) = T(n-k,k-1) + 2*T(n-k,k) + T(n-k,k+1) with T(0,0) = 1 for 0 <= k <= A003056(n).

Original entry on oeis.org

1, 0, 1, 0, 2, 0, 4, 1, 0, 9, 2, 0, 20, 6, 0, 46, 13, 1, 0, 105, 32, 2, 0, 242, 73, 6, 0, 557, 171, 15, 0, 1285, 394, 36, 1, 0, 2964, 914, 85, 2, 0, 6842, 2109, 201, 6, 0, 15793, 4877, 467, 15, 0, 36463, 11261, 1086, 38, 0, 84187, 26014, 2517, 89, 1, 0, 194388
Offset: 0

Views

Author

Seiichi Manyama, Sep 06 2017

Keywords

Examples

			First few rows are:
  1;
  0,    1;
  0,    2;
  0,    4,   1;
  0,    9,   2;
  0,   20,   6;
  0,   46,  13,  1;
  0,  105,  32,  2;
  0,  242,  73,  6;
  0,  557, 171, 15;
  0, 1285, 394, 36, 1.
		

Crossrefs

Row sums give A291930.
Columns 0-1 give A000007, A006958 (for n>0).

A291954 Triangle read by rows: T(n,k) = T(n-k,k-1) - T(n-k,k) with T(0,0) = 1 for 0 <= k <= A003056(n).

Original entry on oeis.org

1, 0, 1, 0, -1, 0, 1, 1, 0, -1, -1, 0, 1, 0, 0, -1, 0, 1, 0, 1, 1, -1, 0, -1, -1, 0, 0, 1, 0, -1, 0, -1, 0, 2, 1, 0, 1, 1, -1, -1, 0, -1, -1, 1, 0, 0, 1, 0, -2, -1, 0, -1, 0, 2, 1, 0, 1, 1, -2, 0, 1, 0, -1, -1, 2, 1, -1, 0, 1, 0, -2, -1, 0, 0, -1, 0, 3, 1, -1, 0, 1
Offset: 0

Views

Author

Seiichi Manyama, Sep 06 2017

Keywords

Examples

			First few rows are:
  1;
  0,  1;
  0, -1;
  0,  1,  1;
  0, -1, -1;
  0,  1,  0;
  0, -1,  0,  1;
  0,  1,  1, -1;
  0, -1, -1,  0;
  0,  1,  0, -1;
  0, -1,  0,  2, 1.
		

Crossrefs

Row sums give A003406.
Columns 0-1 give A000007, A062157.

Formula

G.f. of column k: x^(k*(k+1)/2) / Product_{j=1..k} (1+x^j).

A291940 Triangle read by rows: T(n,k) = T(n-k,k-1) - 2*T(n-k,k) + T(n-k,k+1) with T(0,0) = 1 for 0 <= k <= A003056(n).

Original entry on oeis.org

1, 0, 1, 0, -2, 0, 4, 1, 0, -7, -2, 0, 12, 2, 0, -22, -3, 1, 0, 41, 8, -2, 0, -74, -15, 2, 0, 133, 23, -5, 0, -243, -42, 12, 1, 0, 444, 82, -19, -2, 0, -806, -147, 33, 2, 0, 1465, 261, -65, -5, 0, -2669, -479, 118, 10, 0, 4859, 878, -211, -15, 1, 0, -8840, -1593, 386
Offset: 0

Views

Author

Seiichi Manyama, Sep 06 2017

Keywords

Examples

			First few rows are:
  1;
  0,    1;
  0,   -2;
  0,    4,   1;
  0,   -7,  -2;
  0,   12,   2;
  0,  -22,  -3,  1;
  0,   41,   8, -2;
  0,  -74, -15,  2;
  0,  133,  23, -5;
  0, -243, -42, 12, 1.
		

Crossrefs

Row sums give A291942.
Columns 0-1 give A000007, (-1)*A275762 (for n>0).
Showing 1-5 of 5 results.