OFFSET
1,1
COMMENTS
EXAMPLE
Trace(n) = 2 for n = 7, 14, 23, 34, 47, 62, ..
Trace(n) = -2 for n = 2, 18, 29, 42, 50, 57, 67, ...
Together in increasing order: 2, 7, 14, 18, 23, 29, 34, 42, ...
MATHEMATICA
b[n_] := n^2; bb = Table[b[n], {n, 0, 1000}];
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 *)
Select[Range[800], Abs[u[[#]]] == 2 &] (* A256798 *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Clark Kimberling, Apr 13 2015
STATUS
approved