-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Package to solve the Generalized Pell Equation.
--   
--   Finds all solutions of the generalized Pell Equation.
@package pell
@version 0.1.1.0


-- | This module provides a function to find all square roots of a number
--   modulo another number.
module Math.NumberTheory.Moduli.SquareRoots

-- | <tt>sqrts a m</tt> finds all square roots of <tt>a</tt> modulo
--   <tt>m</tt>, where <tt>a</tt> is an arbitrary integer and <tt>m</tt> is
--   a positive integer.
sqrts :: Integer -> Integer -> [Integer]


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

-- | Represents a solution to a generalized Pell Equation. The first
--   component is the value of x, the second component that of y.
type Solution = (Integer, Integer)

-- | <tt>solve d n</tt> calculates all non-negative integer solutions of
--   the generalized Pell Equation x^2 - <tt>d</tt>y^2 = <tt>n</tt>, where
--   <tt>d</tt> must be a positive integer which is not a square, and
--   <tt>n</tt> must be a non-zero integer.
solve :: Integer -> Integer -> [Solution]
