20221026, 17:59  #1 
Aug 2019
2×3 Posts 
Pell's equation
Hey there!
Attached is a Pell's equation solver program, in PariGP It uses very basic operations but seems to be quick enough. Warning though, if Y^2  N*X^2 does not go to 1 quickly, the numbers tend to become quite prohibitively large. Nothing wrong with that perhaps, but before (and/or if) you run it in Pari, please set the precision to 200odd digits using the command: \p 200 in the terminal window. At least this gives it a good chance of finding answers for larger values of N  though obviously even (relatively) small N values can still have largeish smallest solutions, if you see what I mean?!! Thanks for reading. PS: The code is a bit of a mess atm, with not all variables being used etc. I'll clean it up when I get the time. Cheers. 
20221026, 20:11  #2 
"99(4^34019)99 palind"
Nov 2016
(P^81993)SZ base 36
2×7×263 Posts 
Well, I have a data, for the smallest solution of x^2d*y^2 = 0, +1, +2, +3, +4 (if exists, the +4 case only list primitive solutions, i.e. not a double of the x and y for the +1 case), for d <= 25000
Last fiddled with by Uncwilly on 20221027 at 00:14 Reason: Removing a vast and unneeded quote 
20221026, 20:19  #3 
"Robert Gerbicz"
Oct 2005
Hungary
3^{2}×179 Posts 
That is too slow, there is a pretty nice stuff for Pell equation:
http://library.msri.org/books/Book44.../01lenstra.pdf See section 7, that is really working, I've coded that, not public. 
20221026, 21:29  #4 
Aug 2019
2·3 Posts 
Thanks very much. I was looking for a resource like this to test against online. I have a Pell's Equation book, but it only has a few results in it.

20221028, 03:13  #5 
"99(4^34019)99 palind"
Nov 2016
(P^81993)SZ base 36
2×7×263 Posts 
PARI/GP code for Pell equation: http://www.kaynet.or.jp/~kay/misc/program/pell.gp
Many other computer program codes for Pell equation: https://rosettagit.org/drafts/pellsequation/ Data for solutions of Pell equations: http://www.kaynet.or.jp/~kay/misc/pell2.html and https://raw.githubusercontent.com/xa...20equation.txt and https://raw.githubusercontent.com/xa...le%2025000.txt Online Pell equation solvers: 1. http://www.jakebakermaths.org.uk/mat...ntegerv10.html 2. http://math.fau.edu/richman/pellm.htm 3. http://www.numbertheory.org/php/pell.html 
Thread Tools  
Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Diophantine equation  enzocreti  enzocreti  6  20200323 03:03 
MPQS bparameter and Pelllike equations  Till  Abstract Algebra & Algebraic Number Theory  13  20170120 21:12 
Generalized Pell Equation.  jwaltos  Miscellaneous Math  0  20150829 02:13 
Generalized Pell Numbers  T.Rex  Math  0  20050329 21:16 
Cuberoot Equation  koal  Puzzles  3  20030703 11:58 