# Pell equation and quadratic residues

We say an integer $$k$$ is Pell if there exist some integers $$p,q$$ such that $$p^2k-q^2=1$$

In studying a physics system we ended up with two weaker notions of Pell:

1. We say an integer $$k$$ is pre-Pell if there exist some integers $$p,q$$ such that $$pk-q^2=1$$

2. We say an integer $$k$$ is weakly Pell if there exists some Pell integer $$k'$$ such that the product $$kk'$$ is also Pell.

The physics of the problem led us to conjecture that these two notions are in fact equivalent:

Conjecture: $$k$$ is pre-Pell if and only if it is weakly Pell.

One of the directions is obvious. We have very superficial knowledge of number theory so the only proof we could come up with was using some very strong conjectures (namely, one of the Hardy-Littlewood conjectures), but I think it is safe to assume that a much simpler, unconditional proof should exist. I would appreciate it if someone could sketch it here, or point me in the right direction.

• $k$ is "pre-Pell" if and only if $-1$ is a square modulo $k$, right? Hence, if and only if $k$ has no prime divisor that's one less than a multiple of four, right? "Pell" is a little bit harder, e.g., $34$ has no disqualifying prime divisor, but $q^2-34p^2=-1$ has no integer solutions. – Gerry Myerson Jun 30 '20 at 3:34
• @GerryMyerson Yes, that is correct. (For "pre-Pell" you can also allow a single factor of $2$). Strictly Pell is more complicated, no simple characterisation (in terms of prime factors) is known, to the best of my knowledge. – Delmastro Jun 30 '20 at 15:39

The answer is yes. As was observed, the condition of being pre-Pell is simply the stipulation that $$k$$ is a sum of two squares: that is, if $$p | k$$ and $$p \equiv 3 \pmod{4}$$ then $$p$$ must divide $$k$$ with even multiplicity. If we assume $$k$$ is square-free, then it is divisible only by $$2$$ or primes of congruent to $$1 \pmod{4}$$.

In fact, if $$k$$ is pre-Pell then all of its odd prime divisors must be congruent to $$1 \pmod{4}$$. To see this, suppose $$x^2 + 1$$ is divisible by $$p^2$$ for some $$p \equiv 3 \pmod{4}$$. Then in particular it must be divisible by $$p$$, so the congruence $$x^2 + 1 \equiv 0 \pmod{p}$$ must be soluble. But this is not the case: $$-1$$ is a square mod $$p$$ if and only if $$p = 2$$ or $$p \equiv 1 \pmod{4}$$.

We now work on the equivalences. Suppose that $$k$$ is such that there exists $$k^\prime$$ such that the negative Pell equation is soluble for both $$k^\prime$$ and $$kk^\prime$$. Being a sum of two squares is a necessary condition for negative Pell to be soluble, hence the latter condition implies that $$k = (kk^\prime)/k^\prime$$ must also be a sum of two squares. To see this, suppose that $$kk^\prime$$ has a prime divisor $$p$$ congruent to $$3 \pmod{4}$$ (otherwise it is obvious that $$k$$ is a sum of two squares). Suppose that $$p^{2m} || kk^\prime$$ and $$p^{2n} || k^\prime$$. Then $$p^{2m-2n} || k$$, hence $$p$$ divides $$k$$ to even multiplicity. Therefore, $$k$$ is pre-Pell as desired.

The converse is much harder. Suppose that $$k$$ is a sum of two squares. We can use the fact that for any prime $$p \equiv 1 \pmod{4}$$, the negative Pell equation $$x^2 - py^2 = -1$$ is soluble. Thus we may reduce the question to the following: does there exist a prime $$p \equiv 1 \pmod{4}$$ such that $$x^2 - kpy^2 = -1$$ is soluble?

Fortunately this can be done via governing fields: that is, for each $$k$$ there exists a number field $$F_k$$ such that the 4-rank of the class group of the field $$\mathbb{Q}(\sqrt{kp})$$ is determined by the splitting behaviour of $$p$$ in $$F_k$$. In particular, if the 4-rank of the class group of $$\mathbb{Q}(\sqrt{kp})$$ is zero, then negative Pell is soluble. We are then done by Chebotarev's density theorem guaranteeing the existence of such a prime (in fact, infinitely many).

• Hi, I just came back to this post and got confused again. Pre-Pell is not just the stipulation that $k$ is the sum of two squares: we also require these squares to be coprime, right? Or am I missing something? Thanks! – Delmastro Jan 7 at 21:09