Generalized Pell's equation where $N$ is perfect square

149 Views Asked by At

Are all solutions of the equation $x^2-4My^2=K^2$, multiples of $K$? I am considering $M$ not perfect square. Any tests in Python show be true, but...

My code:

for x in range (1,8000):
    for y in range (1,8000):
            if (x*x-20*y*y)==36:
                print(x,y)

Result: $ 54, 12\\ 966, 216$

All multiples of $6$.

Any can a example of solution coprime (except by factor 2) with K?

2

There are 2 best solutions below

12
On

For the case $M=5, K=6,$ all solutions have $x$ divisible by $6.$

Modulo $2,$ you'd get $x^2\equiv 0\pmod{2},$ so $x$ is even.

Modulo $3,$ you get $x^2+y^2\equiv 0\pmod 3.$ A little work shows that this implies $x$ must be divisible by $3.$


In fact, this shows that if $x^2-20y^2$ is divisible by $6$ then $x$ is divisible by $6.$ It really has nothing to do with the "square" in $6^2.$


If $x^2-4My^2$ is divisible by $2,$ then $x$ will be, of course.

4
On

$$ 21^2 - 20 \cdot 4^2 = 11^2 $$ $$ 21^2 - 20 \cdot 2^2 = 19^2 $$ $$ 61^2 - 20 \cdot 12^2 = 29^2 $$ $$ 41^2 - 20 \cdot 6^2 = 31^2 $$ $$ 49^2 - 20 \cdot 6^2 = 41^2 $$ $$ 69^2 - 20 \cdot 8^2 = 59^2 $$ $$ 101^2 - 20 \cdot 18^2 = 61^2 $$ $$ 89^2 - 20 \cdot 12^2 = 71^2 $$ $$ 81^2 - 20 \cdot 4^2 = 79^2 $$ $$ 161^2 - 20 \cdot 30^2 = 89^2 $$ $$ 141^2 - 20 \cdot 22^2 = 101^2 $$ $$ 141^2 - 20 \cdot 20^2 = 109^2 $$