cp's OEIS Frontend

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.

A257021 Numbers whose quarter-square representation consists of four terms.

This page as a plain text file.
%I A257021 #4 Apr 15 2015 15:43:02
%S A257021 255,271,287,304,321,339,357,376,395,399,415,419,435,439,456,460,477,
%T A257021 481,499,503,521,525,544,548,567,571,575,591,595,599,615,619,623,640,
%U A257021 644,648,665,669,673,691,695,699,717,721,725,744,748,752,771,775,779,799
%N A257021 Numbers whose quarter-square representation consists of four terms.
%C A257021 Every positive integer is a sum of at most four distinct quarter squares (see A257019).
%H A257021 Clark Kimberling, <a href="/A257021/b257021.txt">Table of n, a(n) for n = 1..1000</a>
%e A257021 Quarter-square representations:
%e A257021 r(255) = 240 + 12 + 2 + 1; four terms
%e A257021 r(6969) = 6889 + 72 + 6 + 2; four terms
%t A257021 z = 100; b[n_] := Floor[(n + 1)^2/4]; bb = Table[b[n], {n, 0, 100}];
%t A257021 s[n_] := Table[b[n], {k, b[n + 1] - b[n]}];
%t A257021 h[1] = {1}; h[n_] := Join[h[n - 1], s[n]];
%t A257021 g = h[100]; r[0] = {0};
%t A257021 r[n_] := If[MemberQ[bb, n], {n}, Join[{g[[n]]}, r[n - g[[n]]]]];
%t A257021 u = Table[Length[r[n]], {n, 0, 4 z}];(* A257023 *)
%t A257021 Flatten[-1 + Position[u, 1]]; (* A002620 *)
%t A257021 Flatten[-1 + Position[u, 2]]; (* A257019 *)
%t A257021 Flatten[-1 + Position[u, 3]]; (* A257020 *)
%t A257021 Flatten[-1 + Position[u, 4]]; (* A257021 *)
%Y A257021 Cf. A002620, A257019, A257020, A257023.
%K A257021 nonn,easy
%O A257021 1,1
%A A257021 _Clark Kimberling_, Apr 15 2015