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.

A256697 Trace of the minimal alternating triangular-number representation of n.

Original entry on oeis.org

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

Views

Author

Clark Kimberling, Apr 11 2015

Keywords

Comments

See A255974 for definitions.

Examples

			R(0) = 0; trace = 0
R(1) = 1; trace = 1
R(2) = 3 - 1; trace = -1
R(3) = 3; trace = 3
R(4) = 6 - 3 + 1; trace = 1
R(5) = 6 - 1; trace = -1
R(8) = 10 - 3 + 1; trace = 1
R(11) = 15 - 6 + 3 - 1; trace = -1
		

References

  • 0

Crossrefs

Programs

  • Mathematica
    b[n_] := n (n + 1)/2; bb = Table[b[n], {n, 0, 1000}];
    s[n_] := Table[b[n], {k, 1, n}];
    h[1] = {1}; h[n_] := Join[h[n - 1], s[n]];
    g = h[100]; r[0] = {0};
    r[n_] := If[MemberQ[bb, n], {n}, Join[{g[[n]]}, -r[g[[n]] - n]]]
    t = Table[r[n], {n, 0, 120}]  (* A255974 representations *)
    t = Table[Last[r[n]], {n, 0, 120}] (* A256697 *)

A256699 Numbers with negative triangular trace.

Original entry on oeis.org

2, 5, 7, 9, 11, 12, 14, 17, 18, 20, 22, 24, 25, 27, 30, 32, 33, 35, 37, 39, 41, 42, 44, 47, 49, 51, 52, 54, 56, 58, 60, 62, 63, 65, 68, 70, 72, 74, 75, 77, 81, 83, 85, 87, 88, 90, 92, 95, 97, 99, 101, 102, 104, 107, 110, 112, 114, 116, 117, 119, 121, 123
Offset: 1

Views

Author

Clark Kimberling, Apr 11 2015

Keywords

Comments

Are the differences all 1, 2, 3, or 4? See A255974 for definitions.

Examples

			R(0) = 0; trace = 0
R(1) = 1; trace = 1
R(2) = 3 - 1; trace = -1
R(3) = 3; trace = 3
R(4) = 6 - 3 + 1; trace = 1
R(5) = 6 - 1; trace = -1
R(6) = 6; trace = 6
R(7) = 10 - 3; trace = -3
Thus, 1, 3, 4, 6, ... have positive trace, and 2, 5, 7, .... have negative trace.
		

Crossrefs

Cf. A255974, A256697, A256698 (complement)

Programs

  • Mathematica
    b[n_] := n (n + 1)/2; bb = Table[b[n], {n, 0, 1000}];
    s[n_] := Table[b[n], {k, 1, n}];
    h[1] = {1}; h[n_] := Join[h[n - 1], s[n]]; g = h[100]; r[0] = {0};
    r[n_] := If[MemberQ[bb, n], {n}, Join[{g[[n]]}, -r[g[[n]] - n]]]
    Table[Last[r[n]], {n, 0, 300}]   (* A256697 *)
    Select[Range[200], Last[r[#]] > 0 &]  (* A256698 *)
    Select[Range[200], Last[r[#]] < 0 &]  (* A256699 *)
Showing 1-2 of 2 results.