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

A284441 Base-3 generalized Pascal triangle P_3 read by rows (see Comments for precise definition).

Original entry on oeis.org

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

Views

Author

Manon Stipulanti, Mar 27 2017

Keywords

Comments

List the base-3 numbers in their natural order as base-3 strings, beginning with the empty string epsilon, which represents 0. Row n of the triangle gives the number of times the k-th string occurs as a (scattered) substring of the n-th string.

Examples

			Triangle begins:
1,
1, 1,
1, 0, 1,
1, 1, 0, 1,
1, 2, 0, 0, 1,
1, 1, 1, 0, 0, 1,
1, 0, 1, 0, 0, 0, 1
1, 1, 1, 0, 0, 0, 0, 1,
1, 0, 2, 0, 0, 0, 0, 0, 1,
1, 1, 0, 2, 0, 0, 0, 0, 0, 1,
1, 2, 0, 1, 1, 0, 0, 0, 0, 0, 1,
1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 1,
1, 2, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 1,
1, 3, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 1
...
The base-3 numbers are epsilon, 1, 2, 10, 11, 12, 20, 21, 22, 100, 101, 102, 110, 111, 112, 120, 121, 122, 200, 201, 202, 210, 211, 212, 220, 221, 222, ...  The tenth number 101 contains
eps 1 2 10 11 12 20 21 22 100 101 respectively
.1..2.0..1..1..0..0..0..0..0...1 times, which is row 10 of the triangle.
		

Crossrefs

Cf. A282715 (gives (essentially) the number of nonzero entries in the rows), A284442 (their partial sums).

Programs

  • Mathematica
    coeff[u_, v_] := coeff[u, v] = If[Length[v] == 0, 1, If[Length[u] < Length[v], 0, coeff[Drop[u, -1], v] + ((Last[u] == Last[v]) /. {True -> 1, False -> 0}) coeff[Drop[u, -1], Drop[v, -1]]]]
    P3 = Table[coeff[IntegerDigits[i, 3] /. {0} -> {},IntegerDigits[j, 3] /. {0} -> {}], {i, 0, 3^5 - 1}, {j, 0, i}] //Flatten

A284442 Number of nonzero terms in first n rows of the base-3 generalized Pascal triangle P_3 (A284441).

Original entry on oeis.org

0, 1, 3, 5, 8, 11, 15, 18, 22, 25, 29, 34, 40, 45, 49, 55, 62, 69, 75, 79, 85, 90, 97, 103, 110, 115, 121, 125, 130, 137, 145, 153, 160, 170, 180, 191, 200, 207, 215, 225, 232, 237, 245, 256, 266, 275, 285, 298, 310, 323
Offset: 0

Views

Author

Manon Stipulanti, Mar 27 2017

Keywords

Crossrefs

Partial sums of A282715.
Cf. A284441.
Showing 1-2 of 2 results.