Find a solution in positive integers to :

a) x^2 -41y^2 = -1

b)x^2 - 41y^2 =1

Could you please teach me how to solve these two questions? Thank you very much.

2. Originally Posted by Jenny20
Find a solution in positive integers to :

a) x^2 -41y^2 = -1

b)x^2 - 41y^2 =1

Could you please teach me how to solve these two questions? Thank you very much.
This the variant Pell's equation and Pell's equation. The solutions can be
derived from the continued fraction expansion of sqrt(41).

If a=[a_0: a_1,...] is the CF expansion of sqrt(41) and p_n/q_n is the n-th
convergent of a, then the solutions of a) and b) will be among {(p_n,q_n), n=0,1, ..}.

The following calculations show the solutions:

Code:
>{cf,r}=CF(sqrt(41),8);cf
Column 1 to 6:
6       2       2      12       2       2
Column 7 to 8:
12       2
>
>{p,q,xx}=cnvrgntCT(cf);p,q
Column 1 to 6:
6      13      32     397     826    2049
Column 7 to 8:
25414   52877
Column 1 to 6:
1       2       5      62     129     320
Column 7 to 8:
3969    8258
>
>
>p^2-41*q^2
Column 1 to 6:
-5       5      -1       5      -5       1
Column 7 to 8:
-5       5
>
>
or in tabular form:

Code:
      n       a       p       q       p^2-41q^2
0       6       6       1      -5
1       2      13       2       5
2       2      32       5      -1
3      12     397      62       5
4       2     826     129      -5
5       2    2049     320       1
6      12   25414    3969      -5
7       2   52877    8258       5
So we see that x=32, y=5 is a solution to a), and that x=2049 y=320 is
a solution to b).

RonL

3. Originally Posted by Jenny20
Find a solution in positive integers to :

a) x^2 -41y^2 = -1
What CaptainBlank said hold true for the second problem.
There is however a problem with this one.
It is not a Pell equation.

We see that 41 is a prime that is congruent to 1 modulo 4 thus it does have a solution. (Otherwise it leads to a contradiction in a quadradic residue).

A result by Brouncker is that if,
X and Y satisfy,
X^2-dY^2=-1
then,
x=2dY^2-1
y=2XY
Satisfy,
x^2-dy^2=1
Thus, you solve,
x^2-41y^2=1
And then you can solve for X and Y.
From,
x=2(41)Y^2-1=82Y^2-1
y=2XY

4. ic. thank you very much Perfecthacker.

5. Originally Posted by ThePerfectHacker
What CaptainBlank said hold true for the second problem.
There is however a problem with this one.
It is not a Pell equation.
What I said was that the first was the variant Pell's equation. Which if it has
solutions are also derived from the CF expansion of sqrt(41).

RonL

6. "What I said was that the first was the variant Pell's equation. Which if it has
solutions are also derived from the CF expansion of sqrt(41)."
========================

When I checked by plugging in the answer from Captainblack's table, I found the equation is correct.

x^2 -41y =-1
32^2-41*5^2 = -1

x^2-41y^2 =1
2049^2 - 41*320^2=1

So I think Captianblack's reply to me - original calculation is right!