Karlisbad said:
My question is..how could we use Newton method (or other iterative method ) to solve:
Nx^2 -y^2=1 ??
The main problem i see is that the equation before could have some "non-integer" solutions note that (1) can be put in the form:
\sqrt(Nx^2 -1)=y
Taking your approach Karlisbad, suppose N is a perfect sqaure say N = M^2 then
y^2 = (Mx-1)(Mx+1)
Since Mx-1 and Mx+1 are coprime each must be a perfect square to satisfy the equation that of course is impossible since their difference is 2 whereas the difference of any two consecutive squares is greater than that (2x+1)
Consider, let M be the largest square integer less than N, and K^2 = M.
y^2+1 = Nx^2
This is the same thing as saying
y^2+1 = \sum_{i=1}^{N}x^2
Parametrize y as y = x + k
(x+k)^2+1 = = k^2x^2 + 2xk + k^2 +1= \sum_{i=1}^{N}x^2
Suppose N > k^2 we have
(N-k^2)x^2 - 2xk -k^2-1 = 0
Nx^2 - k^2x^2 = k^2 + 2xk + 1
Let x = 1 and we get
N - k^2 = (k+1)^2
N = (k+1)^2 + k^2
A very long way to say that if x = 1 then you are looking for
y^2+1 = N, but for any integer y you can easily find N.
Let x = 2 and you get y^2 = 4N-1
NO solutions because 3*3 =1 mod 4
Let x = 3 you get y^2 = 9N-1
So do this
(sx^2+r)^2 = x^2N-1
s^2x^4 + 2rsx^2+r^2 = Nx^2-1
r^2 = -1 mod x^2
which means that x^2-1 is a perfect square which is false for x>1. It expects this x^2-1 = t^2 , (x+t)(x-t)=1 in integers that is only satisfied buy x =1, t=0