Denis Simon on Thu, 13 Feb 2025 20:03:26 +0100


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: How to find a solution to this equation so the result is a perfect square ?


Indeed, I forgot a - sign in the expression for X.
You can try:

Y = lift(Mod(s*Z,a));
X = -(Y^2-N*Z^2)/a;

Denis SIMON.

----- Mail original -----
> De: "Laël Cellier" <lael.cellier@laposte.net>
> À: "pari-users" <pari-users@pari.math.u-bordeaux.fr>, "Denis Simon" <denis.simon@unicaen.fr>
> Envoyé: Jeudi 13 Février 2025 17:47:40
> Objet: Re: How to find a solution to this equation so the result is a perfect square ?

> Ok, I understand what you wrote, but it doesn’t always works :
> 
> let’s take a=2032123 and N=1837527 and Z=3. A square root of N mod a is
> s=1214464.
> Following your code this gives Y=1611269 and X=1277566.
> 
> If we apply so those number we get
> ((1611269^2)+(1277566*2032123))/1837527= 179046863551/63363 which
> obviously isn’t a perfect square…
> 
> Cordialement,