2

Is there a way to use Parallelize the following operation, in order to make it do the calculations faster? Or is there another way to speed up this calculation?

With[{ropts = SystemOptions["ReduceOptions"]}, 
  Internal`WithLocalSettings[
   SetSystemOptions[
    "ReduceOptions" -> "SolveDiscreteSolutionBound" -> 10^(14)], 
   Solve[y^2 == 2213326116 + 94098 x (1 + x) (-31363 + 31366 x) && 
     10^(13) <= y <= 10^(14) && x >= 2, {y, x}, Integers], 
   SetSystemOptions[ropts]]] // AbsoluteTiming
Jan Eerland
  • 2,001
  • 10
  • 17

1 Answers1

4

You want $10^{13}\leq y\leq 10^{14}$, so obviously $10^{26}\leq y^2\leq 10^{28}$. The range of $x$ for which your expression $10^{26}\leq y^2 = 2213326116 + 94098\ x\ (1 + x) (-31363 + 31366\ x)\leq 10^{28}$ can be easily found:

N@Reduce[10^26 < 2213326116 + 94098 x (1 + x) (-31363 + 31366 x) <= 10^28, x]

323584. < x <= 1.50194*10^6

That's not a huge range; we can brute-force test all values of $x$ in that range, and we can do that in parallel, e.g. using ParallelDo:

ParallelTable[
 If[
   IntegerQ@Sqrt[2213326116 + 94098 x (1 + x) (-31363 + 31366 x)],
   x, Nothing
 ],
 {x, 300000, 1600000}
]

This is not exactly fast, but it does finish within two minutes on my 4-core machine, whereas your Solve expression was still chugging away after a couple of minutes. This is an embarrassingly parallel operation, i.e. it suffers from no interdependence or communication overhead, so it should see a nice boost from extensive parallelization on many kernels.

Unfortunately, however, it appears that there are no results in that range that this method could find.

MarcoB
  • 67,153
  • 18
  • 91
  • 189