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.

A257024 Number of squares in the quarter-sum representation of n.

This page as a plain text file.
%I A257024 #4 Apr 15 2015 15:44:12
%S A257024 1,1,0,1,1,2,0,1,0,1,2,1,0,1,0,1,1,2,1,2,0,1,0,1,1,1,2,1,2,2,0,1,0,1,
%T A257024 1,2,1,2,1,2,2,3,0,1,0,1,1,2,0,1,2,1,2,2,3,1,0,1,0,1,1,2,0,1,1,2,1,2,
%U A257024 2,3,1,2,0,1,0,1,1,2,0,1,0,1,2,1,2,2
%N A257024 Number of squares in the quarter-sum representation of n.
%C A257024 Every positive integer is a sum of at most four distinct quarter squares; see A257019.
%H A257024 Clark Kimberling, <a href="/A257024/b257024.txt">Table of n, a(n) for n = 0..1000</a>
%e A257024 Quarter-square representations:
%e A257024 r(5) = 4 + 1, so a(5) = 2;
%e A257024 r(11) = 9 + 2, so a(11) = 1;
%e A257024 r(35) = 30 + 4 + 1, so a(35) = 2.
%t A257024 z = 100; b[n_] := Floor[(n + 1)^2/4]; bb = Table[b[n], {n, 0, 100}];
%t A257024 s[n_] := Table[b[n], {k, b[n + 1] - b[n]}];
%t A257024 h[1] = {1}; h[n_] := Join[h[n - 1], s[n]];
%t A257024 g = h[100]; Take[g, 100]; r[0] = {0};
%t A257024 r[n_] := If[MemberQ[bb, n], {n}, Join[{g[[n]]}, r[n - g[[n]]]]]
%t A257024 sq = Table[n^2, {n, 0, 1000}]; t = Table[r[n], {n, 0, z}]
%t A257024 u = Table[Length[Intersection[r[n], sq]], {n, 0, 250}]
%Y A257024 Cf. A002620, A257019, A257020, A257021, A257022.
%K A257024 nonn,easy
%O A257024 0,6
%A A257024 _Clark Kimberling_, Apr 15 2015