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.

A256911 Number of terms in the enhanced triangular-number representation of n.

Original entry on oeis.org

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

Views

Author

Clark Kimberling, Apr 14 2015

Keywords

Comments

See A256909 for definitions. The least n for which R(n) has 5 terms is given by R(7259) = 7140 + 105 + 10 + 3 + 1.

Examples

			R(4) = 3 + 1, so a(4) = 2.
R(119) = 105 + 10 + 3 + 1, so a(119) = 4.
		

Crossrefs

Cf. A000217, A256909 (representations) A256910 (trace).

Programs

  • Mathematica
    b[n_] := n (n + 1)/2; bb = Insert[Table[b[n], {n, 0, 200}], 2, 3]
    s[n_] := Table[b[n], {k, 1, n + 1}];
    h[1] = {0, 1, 2}; h[n_] := Join[h[n - 1], s[n]];
    g = h[200]; r[0] = {0};
    r[n_] := If[MemberQ[bb, n], {n}, Join[{g[[n]]}, r[n - g[[n]]]]];
    t = Table[r[n], {n, 0, 120}] (*A256909 before concatenation*)
    Flatten[t]  (*A256909*)
    Table[Last[r[n]], {n, 0, 120}]    (*A256910*)
    Table[Length[r[n]], {n, 0, 120}]  (*A256911*)