Find all values of $p-q$ if $p, q$ are prime and ${q+1\over q}+{p\over p+1}={2n\over n+2}$ where $n$ is a positive integer.

398 Views Asked by At

Find all values of $q-p$ if $p, q$ are prime and $${q+1\over q}+{p\over p+1}={2n\over n+2}$$ where $n$ is a positive integer.

This problem is a hard problem in my opinion and I am trying to solve it but cannot. I tried to simplify this equation by multiplying by $q(p+1)$ but after later simplification, I got the following: $$2qp+2p+2q=nq-np$$ I couldn't benefit from this. I then tried to use this $2qp+2p+2q=2(1+q)(1+p)-2$ but couldn't. Any help, maybe a hint, would be appreciated. Thank you.

2

There are 2 best solutions below

1
On BEST ANSWER

Rewrite the equation like this: $$ (n+2)(q-p-1)= 4q(p+1)$$ Clearly we see from here that $q>p+1$. Now we have two possibilities:

  • $q\mid q-p-1\implies q\leq q-p-1<q$ a contradiction.
  • $q\mid n+2 \implies q-p-1\mid 4p+4$. Write $$ 4p+4 = k\cdot (q-p-1)\implies \boxed{(p+1)(4+k)=k\cdot q}$$

So $q\mid 4+k$ and $p+1\mid k$. Since $k\mid 4(p+1)$ we see that $k = s(p+1)$ where $s\in\{1,2,4\}$

  1. if $s=1$ then $k=p+1$ so $4+p+1=q$ and thus $p-q = -5$
  2. if $s=2$ then $k=2p+2$ so $4+2p+2=2q$ and thus $p-q = -1$
  3. if $s=4$ then $k=4p+4$ so $4+4p+4=4q$ and thus $p-q = -2$
0
On

Note: This is essentially a streamlined version of greedoid's answer.

We begin by rewriting the equation as

$${1\over p+1}-{1\over q}={4\over n+2}$$

Since the right hand side is positive, we must have $p+1\lt q$. Thus $q$ and $p+1$ are relatively prime (since $q$ is prime), and therefore the left hand side combines to a fraction with a $q(p+1)$ in its reduced denominator. Thus we must have $n+2=q(p+1)k$ for some positive integer $k$, and the equation to satisfy, ${1\over p+1}+{1\over q}={4\over q(p+1)k}$, becomes simply

$$(q-p-1)k=4$$

The possible values for $k$ are $1$, $2$, and $4$, which give $q-p=5$, $3$, and $2$, respectively.

Note that the proof so far has used only the assumption that $q$ is prime. When we include the assumption that $p$ is prime, the first two possibilities for $q-p$ occur only for $(p,q)=(2,7)$ and $(2,5)$; the third corresponds to twin primes.