mersenneforum.org  

Go Back   mersenneforum.org > Extra Stuff > Miscellaneous Math

Reply
 
Thread Tools
Old 2022-10-26, 17:59   #1
Jombo G
 
Aug 2019

2×3 Posts
Post Pell's equation

Hey there!


Attached is a Pell's equation solver program, in Pari-GP

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 200-odd 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 large-ish 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.
Attached Files
File Type: txt Pells Equation Solver_.txt (1.6 KB, 22 views)
Jombo G is offline   Reply With Quote
Old 2022-10-26, 20:11   #2
sweety439
 
"99(4^34019)99 palind"
Nov 2016
(P^81993)SZ base 36

2×7×263 Posts
Default

Quote:
Originally Posted by Jombo G View Post
Attached is a Pell's equation solver program, in Pari-GP
Well, I have a data, for the smallest solution of x^2-d*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
Attached Files
File Type: zip pell solutions for d le 25000.zip (1.02 MB, 50 views)

Last fiddled with by Uncwilly on 2022-10-27 at 00:14 Reason: Removing a vast and unneeded quote
sweety439 is offline   Reply With Quote
Old 2022-10-26, 20:19   #3
R. Gerbicz
 
R. Gerbicz's Avatar
 
"Robert Gerbicz"
Oct 2005
Hungary

32×179 Posts
Default

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.
R. Gerbicz is online now   Reply With Quote
Old 2022-10-26, 21:29   #4
Jombo G
 
Aug 2019

2·3 Posts
Default

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.
Jombo G is offline   Reply With Quote
Old 2022-10-28, 03:13   #5
sweety439
 
"99(4^34019)99 palind"
Nov 2016
(P^81993)SZ base 36

2×7×263 Posts
Default

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/pells-equation/

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/pell-m.htm

3. http://www.numbertheory.org/php/pell.html
sweety439 is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Diophantine equation enzocreti enzocreti 6 2020-03-23 03:03
MPQS b-parameter and Pell-like equations Till Abstract Algebra & Algebraic Number Theory 13 2017-01-20 21:12
Generalized Pell Equation. jwaltos Miscellaneous Math 0 2015-08-29 02:13
Generalized Pell Numbers T.Rex Math 0 2005-03-29 21:16
Cuberoot Equation koal Puzzles 3 2003-07-03 11:58

All times are UTC. The time now is 16:36.


Sat Feb 4 16:36:47 UTC 2023 up 170 days, 14:05, 1 user, load averages: 0.51, 0.78, 0.82

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.

≠ ± ∓ ÷ × · − √ ‰ ⊗ ⊕ ⊖ ⊘ ⊙ ≤ ≥ ≦ ≧ ≨ ≩ ≺ ≻ ≼ ≽ ⊏ ⊐ ⊑ ⊒ ² ³ °
∠ ∟ ° ≅ ~ ‖ ⟂ ⫛
≡ ≜ ≈ ∝ ∞ ≪ ≫ ⌊⌋ ⌈⌉ ∘ ∏ ∐ ∑ ∧ ∨ ∩ ∪ ⨀ ⊕ ⊗ 𝖕 𝖖 𝖗 ⊲ ⊳
∅ ∖ ∁ ↦ ↣ ∩ ∪ ⊆ ⊂ ⊄ ⊊ ⊇ ⊃ ⊅ ⊋ ⊖ ∈ ∉ ∋ ∌ ℕ ℤ ℚ ℝ ℂ ℵ ℶ ℷ ℸ 𝓟
¬ ∨ ∧ ⊕ → ← ⇒ ⇐ ⇔ ∀ ∃ ∄ ∴ ∵ ⊤ ⊥ ⊢ ⊨ ⫤ ⊣ … ⋯ ⋮ ⋰ ⋱
∫ ∬ ∭ ∮ ∯ ∰ ∇ ∆ δ ∂ ℱ ℒ ℓ
𝛢𝛼 𝛣𝛽 𝛤𝛾 𝛥𝛿 𝛦𝜀𝜖 𝛧𝜁 𝛨𝜂 𝛩𝜃𝜗 𝛪𝜄 𝛫𝜅 𝛬𝜆 𝛭𝜇 𝛮𝜈 𝛯𝜉 𝛰𝜊 𝛱𝜋 𝛲𝜌 𝛴𝜎𝜍 𝛵𝜏 𝛶𝜐 𝛷𝜙𝜑 𝛸𝜒 𝛹𝜓 𝛺𝜔