Solving Pell's equation(or any other diophantine equation) through modular arithmetic.

1.3k Views Asked by At

Let us take a solution of Pell's equation ($x^2 - my^2 = 1$) and take any prime $p$. Then we have found a solution of the Pell's equation mod $p$.

Now, conversely, for any prime $p$, we can find a solution of Pell's equation. My question is whether we can use these solutions mod $p$ to build a solution in the integers.

2

There are 2 best solutions below

3
On BEST ANSWER

About the general matter of deriving the existence of solutions over $\Bbb Q$ from solutions modulo every prime it is worth recalling the classical theorem in Number Theory that goes under the name of Hasse's Principle that a quadratic form $$ F(X_1,..X_n)=\sum_{1\geq i\geq j\geq n}a_{ij}X_iX_j\in\Bbb Q[X_1,...,X_n] $$ represents $0$ (i.e. admits a non-trivial solution of $F(X_1,..X_n)=0$ in $\Bbb Q^n$) if and only if it represents $0$ over $\Bbb R$ and all the $p$-adic fields $\Bbb Q_p$.

In turn, to go from a solution mod $p$ to a solution in $\Bbb Q_p$ one has to apply Hensel's Lemma.

Mind, though, that the proofs are not constructive. E.g., see Serre's book A Course in Arithmetic, Springer GTM 7.

These general results do apply to Pell's equation, because one can homogenize it, i.e. solving $X^2-mY^2=1$ is equivalent to find a representation of $0$ of $$ X^2-mY^2-Z^2. $$ Nonetheless, they are not too conclusive, in the sense that they do not allow to say that there exist solutions of Pell's equation different from the trivial ones, namely $X=\pm1$, $Y=0$.

0
On

For each $p$, Pell's equation will have many solutions modulo $p$. There wil be no way to tell which solution mod one prime matches up with which solution modulo another, so you won't be able to use the Chinese Remainder Theorem to glue the solutions together.