A256789 R(k), the minimal alternating squares representation of k, concatenated for k = 0, 1, 2,....
0, 1, 4, -2, 4, -1, 4, 9, -4, 9, -4, 1, 9, -4, 2, 9, -1, 9, 16, -9, 4, -1, 16, -9, 4, 16, -4, 16, -4, 1, 16, -4, 2, 16, -1, 16, 25, -9, 1, 25, -9, 4, -2, 25, -9, 4, -1, 25, -9, 4, 25, -4, 25, -4, 1, 25, -4, 2, 25, -1, 25, 36, -16, 9, -4, 1, 36, -9, 36, -9, 1
Offset: 0
Examples
R(0) = 0 R(1) = 1 R(2) = 4 - 2 R(3) = 4 - 1 R(4) = 4 R(5) = 9 - 4 R(6) = 9 - 4 + 1 R(7) = 9 - 4 + 2 R(89) = 100 - 16 + 9 - 4
Links
- Clark Kimberling, Table of n, a(n) for n = 0..1000
Programs
-
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, individual representations *) Flatten[Table[r[n], {n, 0, 120}]] (* A256789, concatenated representations *)
Comments