Bill Allombert on Sun, 12 Jan 2025 12:14:30 +0100
|
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: What’s the equivalent of Mathematica’s Solve[] Function in Pari/Gp ?
|
- To: pari-users@pari.math.u-bordeaux.fr
- Subject: Re: What’s the equivalent of Mathematica’s Solve[] Function in Pari/Gp ?
- From: Bill Allombert <Bill.Allombert@math.u-bordeaux.fr>
- Date: Sun, 12 Jan 2025 12:14:26 +0100
- Delivery-date: Sun, 12 Jan 2025 12:14:30 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/simple; d=math.u-bordeaux.fr; s=2022; t=1736680468; bh=leP3GNlHSrlsnHfnawoiRhOphBqvyzMAG7iGVZsUMMo=; h=Date:From:To:Subject:References:In-Reply-To:From; b=H4i6Ji7MVSpS/FAA2SkG29B2qN89HzXzgybRiGa/rhoj4T8ADqaswjThc+4z03E+g NnNRamRKp+w9cIHxWuXVbJ6Q2JbFeK3tTUCUqqWz6ns915Gh1IN7yCLMlnZ3DX1NGv SafYcMB/xXOXBhqSwvzV36aWqZUjzhcaafJz/gpgj4kAjiwJeGVn7LJWTC0a1iMwew zQVVsN6H66rF2Q5yiBmCrSjn0vXQTQSg5IUQwJvqQ/Rg5spt5j9ow7Zb6bMTDTZaF2 ZyfGe6qXU0FQDZ/piSdlwAewVCHYq+6jS2dv72sBIssxvUz12cEe6fe2lbVvGplg/p Ac6mmBSwv5JPec8p0zjMEW7bhXuKTJpn/QwYPN6Kb8rmCRAT3pZelW5gvjYuFFrNe3 9R9BSXqyBpXT48TzakYbO5K38TdhJVtwTxCP8kwb9OYLeqJz8214Hr+7dG+xYA9WNZ fZfujjcMZqS/n8EnEYE8uiq0X1BcBLP52yT1DiZOzeICNnnEjmK3RkYu2C6hfPjWJR E3z4Qao4Jb35YdQkux6UC8XdcP+IDAnc2ukv2cJuIBgRTwTaFyz06b7kZJtwGvim4S TyyNLlGb+XA3PEeZoG0YBmxH5aGaIVKMqbzp/CjSWMj6pPw/swjLGWxVd71RyTcyX5 yWzcJCuAkonL0H8eJ2XeaVU0=
- In-reply-to: <bb4aa01f-d5ca-460c-978c-93df60c60452@laposte.net>
- Mail-followup-to: pari-users@pari.math.u-bordeaux.fr
- References: <c04a3a7d-801e-4d5a-a5d9-3d1103685924@laposte.net> <Z4L4RibKD7IpeI-j@seventeen> <bb4aa01f-d5ca-460c-978c-93df60c60452@laposte.net>
On Sun, Jan 12, 2025 at 11:46:43AM +0100, Laël Cellier wrote:
> No,
>
> it stops after finding the first solution instead of returning every
> possible values and that’s what I’m needing.
Given the size of the solution it cannot just try all integers until finding
one that works, it must do something smarter.
> And even if gcdext was the
> solution, how would I be able to use it since the equation contains a ==
> sign ?
Every equation contains a equal sign by definition.
Set
RSA260=22112825529529666435281085255026230927612089502470015394413748319128822941402001986512729726569746599085900330031400051170742204560859276357953757185954298838958709229238491006703034124620545784566413664540684214361293017694020846391065875914794251435144458199
F=(sqrtint(RSA260)+1)^2
You want to solve
((25)^2 + x RSA260)/(y) == F
after multiplying by y one get:
x*RSA260 -F*y == -(25^2)
Compute
[X,Y,d]=gcdext(RSA260,F)
we find d=1 so
X*RSA260 + Y*F == 1
So you just need to multiply by -(25^2)
-(25^2)*X*RSA260 -(25^2)*Y*F == -(25^2)
hence the solution is
x = -(25^2)*X
y = (25^2)*Y
Cheers,
Bill.