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.

A297788 Number of partitions of n into 3 squares and a nonnegative cube.

This page as a plain text file.
%I A297788 #15 Jan 11 2018 23:47:00
%S A297788 1,2,2,2,2,2,2,1,2,4,4,3,3,3,3,1,2,5,5,4,3,3,3,1,2,5,6,6,4,4,5,2,3,6,
%T A297788 6,6,5,6,5,3,3,7,6,4,6,6,6,2,3,7,6,7,6,7,8,3,4,6,6,6,5,6,8,4,4,9,8,8,
%U A297788 7,8,7,2,6,10,9,8,8,9,7,2,6,12,11,8,7,7
%N A297788 Number of partitions of n into 3 squares and a nonnegative cube.
%C A297788 When n is not of the form 4^a * (8b + 7), according to Legendre's three-square theorem, n = x^2 + y^2 + z^2 = x^2 + y^2 + z^2 + 0^3 (where a, b, x, y and z are nonnegative integers with x <= y <= z).
%C A297788 If n = 8b + 7, then n - 1 = 8b + 6 is not of the form 4^a * (8b + 7). So n = (n - 1) + 1 = x^2 + y^2 + z^2 + 1^3.
%C A297788 If n = 4 * (8b + 7), then n - 1 = 8 * (4b + 3) + 3 is also not of the form 4^a * (8b + 7).
%C A297788 If n = 4^2 * (8b + 7), then n - 8 = 4 * (8 * (4b + 3) + 2) is not of the form 4^a * (8b + 7).  n = (n - 8) + 8 = x^2 + y^2 + z^2 + 2^3.
%C A297788 If n = 4^k * (8b + 7) (k >= 3), then n - 8 = 4 * (8 * (4^(k - 1) * b + 4^(k - 3) * 14) - 2) = 4 * (8m - 2) is also not of the form 4^a * (8b + 7).
%C A297788 That is, every nonnegative integer can be represented as the sum of 3 squares and a nonnegative cube, so a(n) > 0.
%H A297788 Robert Israel, <a href="/A297788/b297788.txt">Table of n, a(n) for n = 0..10000</a>
%H A297788 Wikipedia, <a href="https://en.wikipedia.org/wiki/Legendre%27s_three-square_theorem">Legendre's three-square theorem</a>
%e A297788 2 = 0^2 + 0^2 + 1^2 + 1^3 = 0^2 + 1^2 + 0^2 + 1^3, a(2) = 2.
%e A297788 9 = 0^2 + 0^2 + 1^2 + 2^3 = 0^2 + 1^2 + 0^2 + 2^3 = 0^2 + 2^2 + 2^2 + 1^3 = 1^2 + 2^2 + 2^2 + 0^3, a(9) = 4.
%p A297788 N:= 100: # to get a(0)..a(N)
%p A297788 A:= Array(0..N):
%p A297788 for x from 0 to floor(sqrt(N)) do
%p A297788   for y from 0 to x while x^2 + y^2 <= N do
%p A297788     for z from 0 to y while x^2 + y^2 + z^2 <= N do
%p A297788       for w from 0 do
%p A297788         t:= x^2 + y^2 + z^2 + w^3;
%p A297788         if t > N then break fi;
%p A297788         A[t]:= A[t]+1;
%p A297788 od od od od:
%p A297788 convert(A,list); # _Robert Israel_, Jan 11 2018
%t A297788 a[n_]:=Sum[If[x^2+y^2+z^2+w^3==n, 1, 0], {x,0,n^(1/2)}, {y,x,(n-x^2)^(1/2)}, {z,y,(n-x^2-y^2)^(1/2)}, {w,0,(n-x^2-y^2-z^2)^(1/3)}]
%t A297788 Table[a[n], {n,0,86}]
%Y A297788 Cf. A002635, A004215, A274274.
%K A297788 nonn
%O A297788 0,2
%A A297788 _XU Pingya_, Jan 06 2018