A336205 Numbers k that can be expressed as x^3 + y^3 + z^3 with x^2 + y^2 + z^2 <= k where x, y, z are integers.
0, 1, 2, 3, 6, 7, 8, 9, 10, 15, 16, 17, 18, 19, 20, 24, 25, 26, 27, 28, 29, 34, 35, 36, 37, 38, 43, 45, 46, 48, 53, 54, 55, 56, 57, 60, 61, 62, 63, 64, 65, 66, 69, 71, 72, 73, 80, 81, 83, 88, 90, 91, 92, 97, 98, 99, 100, 101, 106, 109, 116, 117, 118, 119, 120, 123, 124, 125, 126, 127, 128, 129, 132
Offset: 1
Examples
11 is not a term because there is no (x,y,z) with x^2 + y^2 + z^2 <= 11 when x^3 + y^3 + z^3 = 11. 18 is a term because (-1)^3 + (-2)^3 + 3^3 = 18 and (-1)^2 + (-2)^2 + 3^2 <= 18. 61 is a term because (-4)^3 + 0^3 + 5^3 = 61 and (-4)^2 + 0^2 + 5^2 <= 61. 354 is a term because (-11)^3 + (-8)^3 + 13^3 = (-11)^2 + (-8)^2 + 13^2 = 354.
Links
- Robert Israel, Table of n, a(n) for n = 1..8000
- Rémy Sigrist, C program for A336205
Programs
-
C
See Links section.
-
Maple
filter:= proc(n) local x,y,z,e1,e2; for x from 0 while 3*x^2 <= n do for y from 0 while x^2 + 2*y^2 <= n do for e1 in [-1,1] do for e2 in [-1,1] do z:= surd(n + e1*x^3 + e2*y^3,3); if z::integer and x^2 + y^2 + z^2 <= n then return true fi; od od od od; false end proc: select(filter, [$0..200]); # Robert Israel, Jul 12 2020
-
Mathematica
filter[n_] := Module[{x, y, z, e1, e2}, For[x = 0, 3*x^2 <= n, x++, For[y = 0, x^2 + 2*y^2 <= n, y++, For[e1 = -1, e1 <= 1, e1 += 2, For[e2 = -1, e2 <= 1, e2 += 2, z = (n + e1*x^3 + e2*y^3)^(1/3); If[IntegerQ[z] && x^2 + y^2 + z^2 <= n, Return[True]] ]]]]; False]; Select[Range[0, 200], filter] (* Jean-François Alcover, Aug 11 2023, after Robert Israel *)
Comments