# Quadratic Diophantine equations with all values prime

Given a quadratic Diophantine equation over the integers in two variables, can we say much about when it has only finitely many solutions with the additional assumption that both variables are prime?

That is, given integers $$a$$, $$b$$, $$c$$, $$d$$, and $$e$$, $$a$$ and $$c$$ both non-zero. Then it seems reasonable to conjecture that there are only finitely many primes $$x$$ and $$y$$ with $$ax^2 +bxy +cy^2 + dx +ey + f=0,$$ barring the exceptional case where the left-hand side itself factors.

The obvious heuristic here is that solutions to the equation (whether or not they are prime) should grow roughly exponentially based on standard methods to solve quadratic Diophantine equation. Thus, if we call the $$n$$th solution, $$(x_n,y_n)$$ then the chance they are both prime should be $$O(\frac{1}{\log k^n})=O(\frac{1}{n})$$ (where $$k$$ is some constant). So the chance they are both prime is about $$O(\frac{1}{n^2})$$, and so the relevant series converges, since $$\sum_{n \geq 1} \frac{1}{n^2}$$ converges.

There are some cases where it is not hard to prove this sort of conjecture, using completely elementary methods. For example, it is not hard to show the following:

Proposition: Suppose that $$p$$ is prime, $$b \geq 1$$, $$m \geq 2$$, $$a \geq 1$$, and $$p^2 + bp + ma^2 = mq^2.$$ Then $$p \leq b + 4am$$.

Proof sketch: The equation can be written as $$p(p+b)=m(q-a)(q+a)$$ and so $$p$$ needs to divide one of the terms on the right-hand side.

One interesting thing here is that in this case, we only need that $$p$$ is prime, which is stronger than what the above heuristic would suggest, since that heuristic uses both variables being prime, whereas here no assumption about the primality of $$q$$. (One can in this case also tighten the bound if one does do a little more work or if one also assumes that $$q$$ is prime.)

My guess is that answering this question in complete generality is going to be tough. So my question then is what broad sets of cases can we prove this for?

• "barring the exceptional case where the right-hand side itself factors"? The RHS is $0$. Feb 7, 2021 at 18:03
• @dodd Sorry, that should be the left hand side. Feb 7, 2021 at 18:03
• for p,q to be the variables, your general quadratic needs to have a constant term $f$ to accommodate the $ma^2$ Feb 7, 2021 at 20:58
• @WillJagy Ah yes, there should be an $f$ term in the original. Good catch. Feb 7, 2021 at 21:05
• Even in the simplest cases this type of question is almost impossible to answer. For example, suppose we are looking at the equation $x^2 - 2y^2 = \pm 1$. The solutions are generated by $1 + \sqrt{2}$, by looking at the rational/irrational parts of $(1 + \sqrt{2})^n$. The rational parts are given by $\sum_{j=0}^{\lfloor n/2 \rfloor} \binom{n}{2j} 2^j$. Asking whether this is prime infinitely often is already well-beyond what we know how to do: we can't even answer this question for the easier looking sequence $2^k - 1$ (the Mersenne sequence). Feb 7, 2021 at 22:13

here's one that puts up a good fight. The table can be extended readily with $$w_{n+4} = 6 w_{n+2} - w_n$$ and same for $$v$$
jagy@phobeusjunior:~$./Pell_Target_Fundamental 2 3 2 23 120 Automorphism matrix: 3 4 2 3 Automorphism backwards: 3 -4 -2 3 3^2 - 2 2^2 = 1 w^2 - 2 v^2 = 23 = 23 Sun Feb 7 13:49:34 PST 2021 1. w: 5 w= 5 v: 1 SEED KEEP +- v = 1 2. w: 11 w= 11 v: 7 SEED BACK ONE STEP 5 , -1 v = 7 3. w: 19 w= 19 v: 13 v = 13 4. w: 61 w= 61 v: 43 v = 43 5. w: 109 w= 109 v: 77 v = 7 11 6. w: 355 w= 5 71 v: 251 v = 251 7. w: 635 w= 5 127 v: 449 v = 449 8. w: 2069 w= 2069 v: 1463 v = 7 11 19 9. w: 3701 w= 3701 v: 2617 v = 2617 10. w: 12059 w= 31 389 v: 8527 v = 8527 11. w: 21571 w= 11 37 53 v: 15253 v = 7 2179 12. w: 70285 w= 5 14057 v: 49699 v = 13 3823 13. w: 125725 w= 5^2 47 107 v: 88901 v = 19 4679 14. w: 409651 w= 11 167 223 v: 289667 v = 7 41381 15. w: 732779 w= 67 10937 v: 518153 v = 518153 16. w: 2387621 w= 2387621 v: 1688303 v = 83 20341 17. w: 4270949 w= 4270949 v: 3020017 v = 7^2 11 13 431 18. w: 13916075 w= 5^2 19 29297 v: 9840151 v = 9840151 19. w: 24892915 w= 5 43 115781 v: 17601949 v = 17601949 Sun Feb 7 13:51:34 PST 2021 w^2 - 2 v^2 = 23 = 23 5, 11, 19, 61, 109, 355, 635, 2069, 3701, 12059, 21571, 70285, 125725, 409651, 732779, 2387621, 4270949, 13916075, 24892915, 1, 7, 13, 43, 77, 251, 449, 1463, 2617, 8527, 15253, 49699, 88901, 289667, 518153, 1688303, 3020017, 9840151, 17601949, jagy@phobeusjunior:~$
• @Wojowu the $w,v$ pairs are solutions of $w^2-2v^2=23$, and the factorizations of $w$ and $v$ indicate that there are a few solutions with both terms prime. Feb 7, 2021 at 22:03
• This probably follows from Schinzel's Hypothesis H, using a Pell equation $x^2 - D y^2 = 1$ with $D$ in one of the families such as $D = n^2 - 1$ for which the solutions $(x,y)$ are polynomials in $n$ (followed by some linear change of variable if needed to get irreducible polynomials with no predictable small factors). Feb 8, 2021 at 0:23
• For each k, I use Schinzel to find n, and thus D, and thus the equation. I can't apply Schinzel to a single Pell-type equation. (I could apply Schinzel to a parabola such as $y = 2x^2-1$.) And no, Green-Tao doesn't apply Dirichlet because Dirichlet says every arithmetic progression $a \bmod q$ contains infinitely many primes as long as $\gcd(a,q)=1$. Feb 8, 2021 at 23:56