pell-0.1.2.0: Package to solve the Generalized Pell Equation.

Copyright(c) 2016 by Dr. Lars Brünjes
LicenseMIT
MaintainerDr. Lars Brünjes <brunjlar@gmail.com>
StabilityProvisional
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

Math.NumberTheory.Pell

Description

This module provides a function to solve generalized Pell Equations, using the "LMM Algorithm" described by John P. Robertson in http://www.jpr2718.org/pell.pdf. A generalized Pell Equation is a diophantine equation of the form x^2 - dy^2 = n, where d is a positive integer which is not a square and where n is a non-zero integer. We are looking for solutions (x,y), where x and y are non-negative integers.

Synopsis

Documentation

type Solution = (Integer, Integer) Source #

Represents a solution to a generalized Pell Equation. The first component is the value of x, the second component that of y.

solve :: Integer -> Integer -> [Solution] Source #

solve d n calculates all non-negative integer solutions of the generalized Pell Equation x^2 - dy^2 = n, where d must be a positive integer which is not a square, and n must be a non-zero integer.