A297788 Number of partitions of n into 3 squares and a nonnegative cube.
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, 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, 7, 8, 7, 2, 6, 10, 9, 8, 8, 9, 7, 2, 6, 12, 11, 8, 7, 7
Offset: 0
Keywords
Examples
2 = 0^2 + 0^2 + 1^2 + 1^3 = 0^2 + 1^2 + 0^2 + 1^3, a(2) = 2. 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.
Links
- Robert Israel, Table of n, a(n) for n = 0..10000
- Wikipedia, Legendre's three-square theorem
Programs
-
Maple
N:= 100: # to get a(0)..a(N) A:= Array(0..N): for x from 0 to floor(sqrt(N)) do for y from 0 to x while x^2 + y^2 <= N do for z from 0 to y while x^2 + y^2 + z^2 <= N do for w from 0 do t:= x^2 + y^2 + z^2 + w^3; if t > N then break fi; A[t]:= A[t]+1; od od od od: convert(A,list); # Robert Israel, Jan 11 2018
-
Mathematica
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)}] Table[a[n], {n,0,86}]
Comments