Well, I have the following code:
ParallelTable[
If[TrueQ[
Sqrt[123*(3*(2*x)^2+167*y^2*x+y*x+4*y^3*x^2)] \[Element] Integers], {{x, y},
Nothing}], {x, 2000,5000}, {y, 1000000000, 1000001000}] //.
Null -> Nothing //. {} -> Nothing
And using this code I am trying to determine for what (x,y) the function 123(3(2x)^2+167y^2x+yx+4y^3x^2) gives a perfect square. Is there a way to improve the speed of this calculation? Every 1000 possibilities take now round about 14 minutes, which is a bit slow.
Is there a way to check if the function I stated in the question is a perfect square, in a more sophisticated way?
Can you show me how to imply that in om my problem?
Quick comparison
Simplify[123*(3*(2*x)^2 + 167*y^2*x + y*x + 4*y^3*x^2)]
(* 123 x (y (1 + 167 y) + 4 x (3 + y^3) *)
f[x_, y_] := 123 x (y (1 + 167 y) + 4 x (3 + y^3);
Table[If[TrueQ[Sqrt[f[x, y]] \[Element] Integers], {x, y}, Nothing], {x, 2000, 5000},
{y, 2000, 5000}] // AbsoluteTiming // First
(* I gave up after waiting for 6 minutes *)
Table[If[sQ[f[x, y]], {x, y}, Nothing], {x, 2000, 5000}, {y, 2000, 5000}] //
AbsoluteTiming // First
(* 49.3531 *)
What is the definition of sQ[.]? Now it does not work in my Mathematica.
See the link I posted earlier.
sQ[n_] := FractionalPart@Sqrt[n + 0``1] == 0
sQ[17]
(* False *)
sQ[900]
(* True *)