1

Problem: Find prime solutions to the equation $p^2+1=q^2+r^2$

I welcome you to post your own solutions as well

I have found a strange solution which I can't understand why it works(or what's the math behind it.) Here it is through examples

Put $r=17$(prime) Now $17^2-1=16\times 18=288=2 \times 144$ (a particular factorization)

$\frac {2+144}{2}=73$

$\frac {144-2}{2}=71$

Solution pair $(p,q,r)=(73,71,17)$

Put $r=23$, $23^2-1=22\times 24=8\times 66$

$\frac {8+66}{2}=37$

$\frac {66-8}{2}=29$

Solution pair $(37,29,23)$

It works for each prime except for $2,3,5$ Which generate $(2,2,1),(3,3,1),5,5,1)$

Please explain me how it's working

jimjim
  • 9,855
Akash
  • 303
  • 4
    Voting to reopen. The supposed duplicate says nothing at all about primes. – TonyK Jun 07 '20 at 18:50
  • 1
    Try it for larger primes. It is not clear whether it still works then. Small numbers are often prime. – Peter Jun 07 '20 at 20:38
  • @lulu, the OP seems to be asserting that for any prime $r$ (with some small exceptions), you can find primes $p$ and $q$ such that $(p+q)(p-q)=(r-1)(r+1)$. (It makes sense to except $r=2$ and $3$. I don't see why the OP would except $r=5$, though, if indeed that's what they mean.) – Barry Cipra Jun 07 '20 at 20:54
  • 2
    When you write, Akash, "It works for each prime except for 2,3,5" do you really mean it works for every prime, all the way to infinity? or do you mean, it works for every prime you tried? and, if that's what you mean, how many, or which, primes did you try? – Gerry Myerson Jun 08 '20 at 00:31
  • 1
    Please, Akash, engage with the comments and answers that have been posted. – Gerry Myerson Jun 09 '20 at 13:09
  • Unless $q$ and $r$ must be distinct primes, $r=5$ should not be excluded (see @Barry Cipra), since $7^2+1=5^2+5^2$. Prime solutions for $p^2+1=2r^2$ are rare, however. $41^2+1=2\cdot 29^2$ seems to be the only other one for $p<10^9$. But if $p$ and $q$ are distinct and $r=5$ is excluded, $r=29$ is still included, since there are five other $p, q$ solutions$$(107, 103), (73, 67), (47, 37), (37, 23), (31, 11)$$ – Edward Porcella Jun 10 '20 at 18:23
  • Continuing my previous comment, of the odd-number pairs $(p, r)$ satisfying $p^2+1=2r^2$, familiar because their ratios increasingly approximate $\sqrt 2$, i.e.$$\frac{1}{1}, \frac{7}{5}, \frac{41}{29}, \frac{239}{169}...$$the next pair after $\frac{41}{29}$ such that $p$ and $r$ are both prime is the fifteenth pair, where$$\frac{p}{r}=\frac{63018038201}{44560482149}$$But again, as with $r=29$, even if we exclude this solution for $r=44560482149$, and require that $(q, r)$ be distinct primes, other solutions remain. But for $r=5$, there is no solution if $(r, q)$ must be distinct primes. – Edward Porcella Jun 10 '20 at 22:05

3 Answers3

3

This seems to hold much more broadly than just for primes.

Let$$r^2-1=ab$$where $b>a$, and let $p=\frac{b+a}{2}$ and $q=\frac{b-a}{2}$.

Then the equation $p^2+1=q^2+r^2$ becomes$$\left(\frac{b+a}{2}\right)^2+1=\left(\frac{b-a}{2}\right)^2+ab+1$$and we have$$\frac{b^2+2ab+a^2}{4}+1=\frac{b^2-2ab+a^2+4ab}{4}+1=\frac{b^2+2ab+a^2}{4}+1$$

Addendum: If $r$ is an odd prime, then $p$ and $q$, that is $\frac{b+a}{2}$ and $\frac{b-a}{2}$, can be prime only if both are odd, i.e. only if $b\equiv 2\pmod 4$ and $a\equiv 0\pmod 4$, or vice-versa.

This restricts the number of divisor pairs $a, b$ that need to be considered in determining whether $r^2-1=ab$ for some odd primes $p$ and $q$.

To illustrate, let $r=47$. Then$$r^2-1=ab=2208=2^5\cdot3\cdot23$$Thus the possible $ab$ are $2\cdot 1104$, $6\cdot 368$, and $2^4\cdot 138$.

For $b=1104$, $a=2$, $p=\frac{b+a}{2}=553=7\cdot79$, not prime.

For $b=368$, $a=6$, $p=\frac{b+a}{2}=187=11\cdot17$, not prime.

For $b=138$, $a=2^4$, $p=\frac{b+a}{2}=77=7\cdot11$, not prime.

It seems $47$ is the least prime value of $r>3$ for which$$p^2+1=q^2+r^2$$is true for no primes $p$, $q$.

As @Gerry Myerson shows, $r=193$ is another instance. I've yet to find other primes between these two, but have not looked much beyond $r=97$.

2

Let $r=193$, a prime. Then $$r^2-1=9313^2-9311^2=3107^2-3101^2=323^2-259^2$$ are the only expressions of $r^2-1$ as a difference of two squares, but $9313=67\times139$, and $3101$ and $259$ are both multiples of $7$. Thus, $p^2+1=q^2+r^2$ is impossible in primes $p,q$ for this prime value of $r$.

0

The below identity can be utilized to get prime solutions.

$a^2+1=b^2+c^2$

$(mp+nq)^2+(mn-pq)^2=(mn+pq)^2+(mp-nq)^2$ ---(1)

Since one of the four elements in equation (1) needs to be equal to one we take:

$(mn-pq)=+1 or -1$

We choose:

$(m,n,p,q)=(3,4,11,1)$

$mn-pq=12-11=1$

And we get: $(a,b,c)=(37,29,23)$

Also for, $(m,n,p,q)=(5,7,9,4)$

We get: $(mn-pq)=(35-36)=(-1)$

And, $(a,b,c)= (73,17,71)$

$(m,n,p,q)=(7,6,41,1)$

$(mn-pq)=(42-41)=1$

$(a,b,c)=(293,281,83)$

Robert
  • 71