murshid_islam said:
thanks Zurtex.
I haven't yet seen the pdf files. because right now i don't have an acrobat reader. i'll read those files as soon as i can get hold of a reader.
can you tell me how to solve the general equations of the form
x^2 - D*y^2 = c
if its not too much trouble.
Well it's not too easy to explain over the web. First of all you need to find the continued fraction of the square root of D, this can always be represented for the form:
\sqrt{D} = [a_0; \overline{a_1, a_2, \ldots, a_{n-1}, a_n}]
It happens to be that it's always true that a
n = 2a
0. Now where c > 1. Look at some a
k where 0 < k < n. If there is no a
k = c, then there is no solution.
However, if you find some a
k = c, then this splits into two cases, either when k is even or odd. If k is even then a possible solution \alpha for \alpha = x/y is:
\alpha = [a_0; a_1, a_2, \ldots, a_{k-1}]
If k however is odd the solution is:
\alpha = [a_0; a_1, a_2, \ldots, a_{k-1}, a_k, a_1, a_2, \ldots, a_{k-1}]
For c < -1, it's the same set up (you look at when a
k = |c|), but if I remember rightly you swap the solutions round for whether k is odd or even. When |c| = 1 then it's again the same but you also look at when k = n.
Sometimes there is not solution even when you get a
k = |c|, you need to check it works.
Sorry for my very bad explanation, I actually only learned this into a crammed 2 hour session before I had a test on it, I didn't bother going to lectures. Oh well, I'll borrow some friends notes and make sure this is all correct, but I might not be able to get hold of them for over a week yet. But I know it's more or less correct, mess about with it for a bit if you want to see if you can get it to work.