|
|
A257021
|
|
Numbers whose quarter-square representation consists of four terms.
|
|
7
|
|
|
255, 271, 287, 304, 321, 339, 357, 376, 395, 399, 415, 419, 435, 439, 456, 460, 477, 481, 499, 503, 521, 525, 544, 548, 567, 571, 575, 591, 595, 599, 615, 619, 623, 640, 644, 648, 665, 669, 673, 691, 695, 699, 717, 721, 725, 744, 748, 752, 771, 775, 779, 799
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
COMMENTS
|
Every positive integer is a sum of at most four distinct quarter squares (see A257019).
|
|
LINKS
|
|
|
EXAMPLE
|
Quarter-square representations:
r(255) = 240 + 12 + 2 + 1; four terms
r(6969) = 6889 + 72 + 6 + 2; four terms
|
|
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
|
|
|
STATUS
|
approved
|
|
|
|