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 A257018 #12 Jul 09 2018 23:23:53 %S A257018 0,3,15,255,1,5,19,271,2,7,23,287,4,8,28,304,6,10,33,321,9,11,35,339, %T A257018 12,13,39,357,16,14,41,376,20,17,45,395,25,18,47,399,30,21,52,415,36, %U A257018 22,54,419,42,24,59,435,49,26,61,439,56,27,63,456,64,29,67 %N A257018 Rectangular array read by columns: row i shows the numbers whose greedy quarter-squares representation consists of i terms, for i = 1, 2, 3, 4. %C A257018 Theorem: Every positive integer is a sum of at most four distinct quarter squares (proved at Math Overflow link). The greedy representation is found as follows. Let f(n) be the greatest quarter-square <= n, and apply r(n) = f(n) + r(n - f(n)) until reaching 0. The least term of r(n) is the trace of n, at A257022. %H A257018 Math Overflow, <a href="http://mathoverflow.net/questions/202903/is-every-positive-integer-a-sum-of-at-most-4-distinct-quarter-squares"> Every positive integer a sum of at most 4 distinct quarter-squares</a> %e A257018 The array: %e A257018 0 1 2 4 6 9 12 ... %e A257018 3 5 7 8 10 11 13 ... %e A257018 15 19 23 28 33 35 39 ... %e A257018 255 271 287 304 321 339 357 ... %e A257018 Quarter-square representations: %e A257018 r(0) = 0, %e A257018 r(1) = 1, %e A257018 r(2) = 2, %e A257018 r(3) = 2 + 1, %e A257018 r(15) = 12 + 2 + 1, %e A257018 r(6969) = 6889 + 72 + 6 + 2. %t A257018 z = 200; b[n_] := Floor[(n + 1)^2/4]; bb = Table[b[n], {n, 0, z}]; %t A257018 s[n_] := Table[b[n], {k, b[n + 1] - b[n]}]; %t A257018 h[1] = {1}; h[n_] := Join[h[n - 1], s[n]]; g = h[200]; r[0] = {0}; %t A257018 r[n_] := If[MemberQ[bb, n], {n}, Join[{g[[n]]}, r[n - g[[n]]]]]; %t A257018 u = Table[Length[r[n]], {n, 0, 4 z}] (* A257023 *) %t A257018 TableForm[Table[Take[Flatten[-1 + Position[u, k]], 10], {k, 1, 4}]] (*A257018 array *) %t A257018 t = Table[Take[Flatten[-1 + Position[u, k]], 30], {k, 1, 4}]; %t A257018 Flatten[Table[t[[i, j]], {j, 1, 30}, {i, 1, 4}]] (*A257018 sequence *) %Y A257018 Cf. A257018 (quarter-square sums), A002620 (row 1, the quarter-squares ), A257019 (row 2), A257020 (row 3); A257021 (row 4), A257023 (number of terms). %K A257018 nonn,easy,tabf %O A257018 1,2 %A A257018 _Clark Kimberling_, Apr 15 2015