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.

A158902 Triangle read by rows: the matrix product A051731 * A158821.

Original entry on oeis.org

1, 2, 1, 3, 0, 1, 5, 1, 0, 1, 5, 0, 0, 0, 1, 9, 1, 1, 0, 0, 1, 7, 0, 0, 0, 0, 0, 1, 12, 1, 0, 1, 0, 0, 0, 1, 11, 0, 1, 0, 0, 0, 0, 0, 1, 15, 1, 0, 0, 1, 0, 0, 0, 0, 1, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 23, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 1
Offset: 1

Views

Author

Gary W. Adamson and Mats Granvik, Mar 29 2009

Keywords

Examples

			First few rows of the triangle =
1;
2, 1;
3, 0, 1;
5, 1, 0, 1;
5, 0, 0, 0, 1;
9, 1, 1, 0, 0, 1;
7, 0, 0, 0, 0, 0, 1;
12, 1, 0, 1, 0, 0, 0, 1
11, 0, 1, 0, 0, 0, 0, 0, 1;
15, 1, 0, 0, 1, 0, 0, 0, 0, 1;
11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1;
23, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 1;
13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1;
21, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1;
...
		

Crossrefs

Cf. A158821, A051731, A158901, A000203 (row sums).

Programs

  • Maple
    A158902 := proc(n,k)
        add( A051731(n,j)*A158821(j-1,k-1),j=k..n) ;
    end proc:
    seq(seq(A158902(n,k),k=1..n),n=1..12) ; # R. J. Mathar, Jan 08 2015
  • Mathematica
    m = 12; (* number of rows *)
    T1[n_, k_] := Boole[Mod[n, k] == 0];
    T2[n_, k_] := Which[n == k, 1, k == 1, n-1, True, 0];
    T = Array[T1, {m, m}].Array[T2, {m, m}];
    Table[T[[n, k]], {n, m}, {k, n}] // Flatten (* Jean-François Alcover, Feb 01 2023 *)

Formula

T(n,n) = 1.
T(n,1) = A158901(n).

Extensions

Wrong A-number in definition corrected by Robert Israel, Jan 08 2015