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.

A256909 Enhanced triangular-number representations, concatenated.

Original entry on oeis.org

0, 1, 2, 3, 3, 1, 3, 2, 6, 6, 1, 6, 2, 6, 3, 10, 10, 1, 10, 2, 10, 3, 10, 3, 1, 15, 15, 1, 15, 2, 15, 3, 15, 3, 1, 15, 3, 2, 21, 21, 1, 21, 2, 21, 3, 21, 3, 1, 21, 3, 2, 21, 6, 28, 28, 1, 28, 2, 28, 3, 28, 3, 1, 28, 3, 2, 28, 6, 28, 6, 1, 36, 36, 1, 36, 2
Offset: 0

Views

Author

Clark Kimberling, Apr 13 2015

Keywords

Comments

Let B = {0,1,2,3,6,10,15,21,...}, so that B consists of the triangular numbers together with 0 and 2. We call B the enhanced basis of triangular numbers. Define R(0) = 0 and R(n) = g(n) + R(n - g(n)) for n > 0, where g(n) is the greatest number in B that is <= n. Thus, each n has an enhanced triangular-number representation of the form R(n) = b(m(n)) + b(m(n-1)) + ... + b(m(k)), where b(n) > m(n-1) > ... > m(k) > 0, in which the last term, b(m(k)) is the trace.
The least n for which R(n) has more than 4 terms is given by R(7259) = 7140 + 105 + 10 + 3 + 1.

Examples

			R(0) = 0;
R(1) = 1;
R(2) = 2;
R(3) = 3;
R(4) = 3 + 1;
R(5) = 3 + 2;
R(6) = 6;
R(119) = 105 + 10 + 3 + 1.
		

Crossrefs

Cf. A000217, A256910 (trace), A256911 (number of terms), A255974 (minimal alternating triangular-number representations), A256913 (enhanced squares representations).

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*)
    Table[Last[r[n]], {n, 0, 120}]    (*A256910*)
    Table[Length[r[n]], {n, 0, 120}]  (*A256911*)

A256910 Trace of the enhanced triangular-number representation of n.

Original entry on oeis.org

0, 1, 2, 3, 1, 2, 6, 1, 2, 3, 10, 1, 2, 3, 1, 15, 1, 2, 3, 1, 2, 21, 1, 2, 3, 1, 2, 6, 28, 1, 2, 3, 1, 2, 6, 1, 36, 1, 2, 3, 1, 2, 6, 1, 2, 45, 1, 2, 3, 1, 2, 6, 1, 2, 3, 55, 1, 2, 3, 1, 2, 6, 1, 2, 3, 10, 66, 1, 2, 3, 1, 2, 6, 1, 2, 3, 10, 1, 78, 1, 2, 3, 1
Offset: 0

Views

Author

Clark Kimberling, Apr 13 2015

Keywords

Comments

See A256909 for definitions.

Examples

			R(0) = 0, trace = 0;
R(1) = 1, trace = 1;
R(2) = 2, trace = 2;
R(3) = 3, trace = 3;
R(4) = 3 + 1, trace = 1;
R(5) = 3 + 2, trace = 2;
R(6) = 6, trace = 6;
R(119) = 105 + 10 + 3 + 1, trace = 1.
		

Crossrefs

Cf. A000217, A256909 (definitions), A256911 (number of terms), A255974 (minimal alternating triangular-number representations).

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*)
Showing 1-2 of 2 results.