login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A256794
First differences of A256792.
2
3, 2, 1, 2, 2, 2, 1, 2, 1, 3, 2, 1, 2, 1, 2, 3, 2, 1, 2, 1, 2, 2, 3, 2, 1, 2, 3, 2, 2, 3, 2, 1, 2, 2, 3, 2, 2, 3, 2, 1, 2, 1, 3, 3, 2, 2, 3, 2, 1, 2, 2, 1, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 1, 3, 3, 2, 2, 3, 2, 1, 2, 1, 3, 2, 1, 3, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2
OFFSET
1,1
EXAMPLE
R(0) = 0;
R(1) = 1;
R(2) = 4 - 2;
R(3) = 4 - 1;
R(4) = 4;
R(5) = 9 - 4.
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 *)
CROSSREFS
Sequence in context: A079109 A079099 A213195 * A366899 A068929 A060567
KEYWORD
nonn,easy
AUTHOR
Clark Kimberling, Apr 13 2015
STATUS
approved