I would like to contribute what i know about Pell's equation
--------------------------------------------------------------------------------
Find integer solutions of the following equation, where a is an integer. (ALL numbers involved are integers)
X^2 - a.Y^2 = +/- 1
--------------------------------------------------------------------------------
Fact 1: a cannot be a perfect square, if there are any solutions to exist.
Proof: Let a be a perfect square ==> a=b^2, so
X^2 -b^2.Y^2 = +/- 1
X^2 -(b.Y)^2 = =/-1
(X-b.Y)(X+b.Y) = +/- 1
==> X-b.Y = +/- 1 AND X+b.Y = +/- 1 (in case when it equals 1)
Inconsistent, therefore no integer solutions.
when it equals -1:
==> X-b.Y=-1 AND X+b.Y=1 (in case when it equals -1)
==> X = b.Y-1 AND X = 1-b.Y
==> b.Y - 1 = 1 - b.Y
==> b.Y = 1
==> b=1 AND Y=1 OR b=-1 AND Y=-1
when b=1 a=1^2 = 1 (not a perfect square) Contradiction.
Hence no solutions in this case either.
Remark: This may have been simplified alot, but i made every step clear so
anyone can understand it.
--------------------------------------------------------------------------------
Fact 2: For X^2 - a.Y^2 = 1 , (1,0) is the trivial solution.
Proof: Substitute (1,0):
1^2 - a.0^2 = 1
--------------------------------------------------------------------------------
Fact 3: For X^2 - a.Y^2 = 1 , if (p,q) is one solution then so is:
X = [(p+q.√a)^n + (p-q.√a)^n]/2
Y = [(p+q.√a)^n - (p-q.√a)^n]/2.√a
Proof: If (p,q) is a solution then p^2 - a.q^2 = 1
==> (p^2 - a.q^2)^n = 1
==> X^2 - a.Y^2 = (p^2 - a.q^2)^n = 1
==> (X+Y.√a)(X-Y.√a) = (p+q.√a)^n(p-q.√a)^n
==> X+Y.√a = (p+q.√a)^n
X-Y.√a = (p-q.√a)^n
Adding gives:
2X = (p+q.√a)^n + (p-q.√a)^n
X = [(p+q.√a)^n + (p-q.√a)^n]/2
Subtracting gives:
Y.2√a = (p+q.√a)^n - (p-q.√a)^n
Y = [(p+q.√a)^n - (p-q.√a)^n]/2.√a
--------------------------------------------------------------------------------
Fact 4: X^2 - a.Y^2 = 1 is always solvable if a is non-square.
Proof: Based on the fact that you can always derive a continued fraction for √a.
--------------------------------------------------------------------------------
Fact 5: X^2 - a.Y^2 = -1 will have no solutions if a is a multiple of 4.
Proof: I dont know the formal proof.
--------------------------------------------------------------------------------