This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A256790 #6 Apr 14 2015 11:04:34 %S A256790 1,1,2,2,1,2,3,3,2,1,4,3,2,3,3,2,1,3,4,4,3,2,3,3,2,1,5,2,3,4,4,3,2,3, %T A256790 3,2,1,3,4,5,2,3,4,4,3,2,3,3,2,1,4,4,3,4,5,2,3,4,4,3,2,3,3,2,1,2,3,4, %U A256790 4,3,4,5,2,3,4,4,3,2,3,3,2,1,5,4,2,3 %N A256790 Number of terms in the minimal alternating squares representation of n. %C A256790 See A256789 for definitions. %H A256790 Clark Kimberling, <a href="/A256790/b256790.txt">Table of n, a(n) for n = 0..1000</a> %e A256790 R(0) = 0, so a(0) = 1; %e A256790 R(1) = 1, so a(1) = 1; %e A256790 R(2) = 4 - 2, so a(2) = 2; %e A256790 R(7) = 9 - 4 + 2, so a(7) = 3; %e A256790 R(89) = 100 - 16 + 9 - 4, so a(89) = 4. %t A256790 b[n_] := n^2; bb = Table[b[n], {n, 0, 1000}]; %t A256790 s[n_] := Table[b[n], {k, 1, 2 n - 1}]; %t A256790 h[1] = {1}; h[n_] := Join[h[n - 1], s[n]]; %t A256790 g = h[100]; r[0] = {0}; r[1] = {1}; r[2] = {4, -2}; %t A256790 r[n_] := If[MemberQ[bb, n], {n}, Join[{g[[n]]}, -r[g[[n]] - n]]]; %t A256790 Table[r[n], {n, 0, 120}] (* A256789 *) %t A256790 Flatten[Table[Length[r[n]], {n, 0, 1000}]] (* A256790 *) %Y A256790 Cf. A256789. %K A256790 nonn,easy %O A256790 0,3 %A A256790 _Clark Kimberling_, Apr 13 2015