login
A256791
Trace of n in the minimal alternating squares representation of n.
7
0, 1, -2, -1, 4, -4, 1, 2, -1, 9, -1, 4, -4, 1, 2, -1, 16, 1, -2, -1, 4, -4, 1, 2, -1, 25, 1, -9, 1, -2, -1, 4, -4, 1, 2, -1, 36, 4, -4, 1, -9, 1, -2, -1, 4, -4, 1, 2, -1, 49, -2, -1, 4, -4, 1, -9, 1, -2, -1, 4, -4, 1, 2, -1, 64, -16, 1, -2, -1, 4, -4, 1, -9
OFFSET
0,3
COMMENTS
See A256789 for definitions.
For each positive integer m, the list of 2m numbers between m^2 and (m+1)^2 is repeated between (m+1)^2 and (m+2)^2. Consequently, a limiting sequence is formed by reversing the repeated lists. The limiting sequence is -1, 2, 1, -4, 4, -1, -2, 1, -9, 1, -4, 4, -1, -2, 1, -16, ...
LINKS
EXAMPLE
R(0) = 0, so a(0) = 0;
R(1) = 1, so a(1) = 1;
R(2) = 4 - 2, so a(2) = -2;
R(7) = 9 - 4 + 2, so a(7) = 2;
R(89) = 100 - 16 + 9 - 4, so a(89) = -4.
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 *)
Flatten[Table[Last[r[n]], {n, 0, 100}]] (* A256791 *)
CROSSREFS
Cf. A256789.
Sequence in context: A136756 A214670 A181878 * A274980 A274826 A129862
KEYWORD
easy,sign
AUTHOR
Clark Kimberling, Apr 13 2015
STATUS
approved