%I #65 Aug 11 2023 13:47:36
%S 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,
%T 38,43,45,46,48,53,54,55,56,57,60,61,62,63,64,65,66,69,71,72,73,80,81,
%U 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
%N 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.
%C See A336240 for border case x^2 + y^2 + z^2 = x^3 + y^3 + z^3.
%C What is the natural density of this sequence?
%C There are infinitely many infinite parametric families of solutions which have negative values in (x,y,z). For example, 8*(3*a-1)^2*m^6 + 12*(3*a-1)*(a-1)*m^4 - 6*(2*a-1)*m^2 + 2*a^3 + 1 are terms for all a >= 0, m >= 0. (x = 1 - (6*a-2)*m^2, y = a - m*(1-(6*a-2)*m^2), z = a + m*(1-(6*a-2)*m^2)). - _Altug Alkan_, Jul 17 2020
%C By definition, corresponding (x,y,z) variables are produced by equation x^3 + y^3 + z^3 = x^2 + y^2 + z^2 + t with t >= 0. That is, x^2*(x-1) + y^2*(y-1) + z^2*(z-1) >= 0. Conjecture: Every even integer can be represented as x^2*(x-1) + y^2*(y-1) + z^2*(z-1) where x, y, z are integers. - _Altug Alkan_, Jul 19 2020
%H Robert Israel, <a href="/A336205/b336205.txt">Table of n, a(n) for n = 1..8000</a>
%H Rémy Sigrist, <a href="/A336205/a336205.txt">C program for A336205</a>
%e 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.
%e 18 is a term because (-1)^3 + (-2)^3 + 3^3 = 18 and (-1)^2 + (-2)^2 + 3^2 <= 18.
%e 61 is a term because (-4)^3 + 0^3 + 5^3 = 61 and (-4)^2 + 0^2 + 5^2 <= 61.
%e 354 is a term because (-11)^3 + (-8)^3 + 13^3 = (-11)^2 + (-8)^2 + 13^2 = 354.
%p filter:= proc(n) local x,y,z,e1,e2;
%p for x from 0 while 3*x^2 <= n do
%p for y from 0 while x^2 + 2*y^2 <= n do
%p for e1 in [-1,1] do for e2 in [-1,1] do
%p z:= surd(n + e1*x^3 + e2*y^3,3);
%p if z::integer and x^2 + y^2 + z^2 <= n then return true fi;
%p od od od od;
%p false
%p end proc:
%p select(filter, [$0..200]); # _Robert Israel_, Jul 12 2020
%t filter[n_] := Module[{x, y, z, e1, e2},
%t For[x = 0, 3*x^2 <= n, x++,
%t For[y = 0, x^2 + 2*y^2 <= n, y++,
%t For[e1 = -1, e1 <= 1, e1 += 2, For[e2 = -1, e2 <= 1, e2 += 2,
%t z = (n + e1*x^3 + e2*y^3)^(1/3);
%t If[IntegerQ[z] && x^2 + y^2 + z^2 <= n, Return[True]]
%t ]]]]; False];
%t Select[Range[0, 200], filter] (* _Jean-François Alcover_, Aug 11 2023, after _Robert Israel_ *)
%o (C) See Links section.
%Y Cf. A004825 (subsequence), A060464 (supersequence), A336240.
%K nonn,easy
%O 1,3
%A _Altug Alkan_, Jul 12 2020