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.

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)