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.

A256795 Difference sequence of A256793.

Original entry on oeis.org

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

Views

Author

Clark Kimberling, Apr 13 2015

Keywords

Comments

These are the numbers of consecutive positive traces when the minimal alternating squares representations for positive integers are written in order. Is every term < 5? The first term greater than 3 is a(116) = 4, corresponding to these 3 consecutive representations:
R(225) = 225;
R(226) = 256 - 36 + 9 - 4 + 1;
R(227) = 256 - 36 + 9 - 4 + 2.
(See A256789 for definitions.)

Crossrefs

Programs

  • Mathematica
    b[n_] := n^2; bb = Table[b[n], {n, 0, 1000}];  (* Squares as base *)
    s[n_] := Table[b[n], {k, 1, 2 n - 1}];
    h[1] = {1}; h[n_] := Join[h[n - 1], s[n]];
    g = h[100]; r[0] = {0}; r[1] = {1}; r[2] = {4, -2};
    r[n_] := If[MemberQ[bb, n], {n}, Join[{g[[n]]}, -r[g[[n]] - n]]];
    Table[r[n], {n, 0, 120}]; (* A256789 *)
    u = Flatten[Table[Last[r[n]], {n, 1, 1000}]];  (* A256791 *)
    u1 = Select[Range[800], u[[#]] > 0 &]; (* A256792 *)
    u2 = Select[Range[800], u[[#]] < 0 &]; (* A256793 *)
    Differences[u1]  (* A256794 *)
    Differences[u2]  (* A256795 *)