Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #8 Apr 14 2015 11:04:42
%S 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,
%T -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,
%U -4,1,-9,1,-2,-1,4,-4,1,2,-1,64,-16,1,-2,-1,4,-4,1,-9
%N Trace of n in the minimal alternating squares representation of n.
%C See A256789 for definitions.
%C 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, ...
%H Clark Kimberling, <a href="/A256791/b256791.txt">Table of n, a(n) for n = 0..999</a>
%e R(0) = 0, so a(0) = 0;
%e R(1) = 1, so a(1) = 1;
%e R(2) = 4 - 2, so a(2) = -2;
%e R(7) = 9 - 4 + 2, so a(7) = 2;
%e R(89) = 100 - 16 + 9 - 4, so a(89) = -4.
%t b[n_] := n^2; bb = Table[b[n], {n, 0, 1000}];
%t s[n_] := Table[b[n], {k, 1, 2 n - 1}];
%t h[1] = {1}; h[n_] := Join[h[n - 1], s[n]];
%t g = h[100]; r[0] = {0}; r[1] = {1}; r[2] = {4, -2};
%t r[n_] := If[MemberQ[bb, n], {n}, Join[{g[[n]]}, -r[g[[n]] - n]]];
%t Table[r[n], {n, 0, 120}] (* A256789 *)
%t Flatten[Table[Last[r[n]], {n, 0, 100}]] (* A256791 *)
%Y Cf. A256789.
%K easy,sign
%O 0,3
%A _Clark Kimberling_, Apr 13 2015