Message Boards Message Boards

In terms of performance, how to get a solution to this equation with y being a perfect square ?

Posted 1 month ago

Simple question, I’ve the following type of equation to solve in order to build the inputs parameters for an algorithm :

Solve[(25^2 + x digitsConstant260)/(y 67) == digitsConstant300, {x, y}, Integers]

which can be solved by wolfram in this case, but I want $y×67$ to be a perfect square and $x \in \Bbb{Z}$, so I tried :

Solve[((25)^2 + x digitsConstant260)/((y 67 67)^2) == digitsConstant300, {x, y}, Integers]

with the idea that $(67^2×y)^2$ would be the square root of the real value and thus squaring it would lead to the real value. The problem is that time it hang because of the size of the constants. Is there an other way to rewrite the equation so that Mathematica can both solve it and have a resulting y which is a perfect square ?

Any constant large enough triggers the hang that prevents equation solving to finish : for example try,

digitsConstant260=0xdc4e445b69fe9483216d0fa85492b4656287bfb2fb4da5b65f0b86cc2c073f3ee24a038d3d0e88c78b722b466c5ca1c89792c368ed182a5a13df919cac7fe335173cd04f23769d5ef027290f34a86e8fcab014f1a19d395b0662c5c52424a38796dd6f2394047d716abb6f48cc46abee6e2be3168348b456d5878cbec0b57d0f
digitsConstant300=0xdc4e445b69fe9483216d0fa85492b4656287bfb2fb4da5b65f0b86cc2c073f3ee24a038d3d0e88c78b722b466c5ca1c89792c368ed182a5a13df919cac7fe3362dc72d3863d2ca8b36753d05dac4f1a77220ae2bbdbeb3e2b8e856a51da81c5f4295ea43a893923b7bc0cb9362f78c69a8e252d9af532e889ded7597a256f8e4

Please note in the end the solution doesn’t have to use Mathematica or any other proprietary software.

POSTED BY: Laël Cellier

Please add links to/from MSE crosspost thread.

POSTED BY: Daniel Lichtblau
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract