OFFSET
1,1
COMMENTS
Every positive integer is a sum of at most four distinct quarter squares (see A257019).
LINKS
Clark Kimberling, Table of n, a(n) for n = 1..1000
EXAMPLE
Quarter-square representations:
r(0) = 0, one term
r(1) = 1, one term
r(3) = 2 + 1, two terms, so a(1) = 3
MATHEMATICA
z = 100; b[n_] := Floor[(n + 1)^2/4]; bb = Table[b[n], {n, 0, 100}];
s[n_] := Table[b[n], {k, b[n + 1] - b[n]}];
h[1] = {1}; h[n_] := Join[h[n - 1], s[n]];
g = h[100]; r[0] = {0};
r[n_] := If[MemberQ[bb, n], {n}, Join[{g[[n]]}, r[n - g[[n]]]]];
u = Table[Length[r[n]], {n, 0, 4 z}]; (* A257023 *)
Flatten[-1 + Position[u, 1]]; (* A002620 *)
Flatten[-1 + Position[u, 2]]; (* A257019 *)
Flatten[-1 + Position[u, 3]]; (* A257020 *)
Flatten[-1 + Position[u, 4]]; (* A257021 *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Clark Kimberling, Apr 15 2015
STATUS
approved