/Pell

Pell's equation solver

Primary LanguagePythonMIT LicenseMIT

Pell

Pell's equation solver

Abstract

pell.py contains function to solve Pell's equation. Main code calculate solutions for 1 <= D <= 1000.

Some math

Continued fractions calculates with next algorithm:
http://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Continued_fraction_expansion

Convergent fractions calculates with next formulas:
http://ru.wikipedia.org/wiki/%D0%9F%D0%BE%D0%B4%D1%85%D0%BE%D0%B4%D1%8F%D1%89%D0%B0%D1%8F_%D0%B4%D1%80%D0%BE%D0%B1%D1%8C#.D0.9F.D0.BE.D0.B4.D1.85.D0.BE.D0.B4.D1.8F.D1.89.D0.B8.D0.B5_.D0.B4.D1.80.D0.BE.D0.B1.D0.B8