Find $p,q$ such that $p+q-pq+1=0$ where $p,q$ are primes with $p
Find $p,q$ such that $p+q-pq+1=0$ where $p,q$ are primes with $p<q$.
My try:
If we take $p=2,q=3$ the equality is satisfied.
But how can I show that this is the only solution?
 A: $p+q-pq+1=0 $
$\implies p+q-pq-1=-2 $
$\implies (p-1)(q-1)=2$ 
$\implies \text{ either } p-1=2  \text{ and } q-1=1 $ 
$\text{ or } q-1=2 \text{ and } p-1=1 .$
A: In general, we have $$q=\frac{p+1}{p-1},$$
which is integral only when $p=2$ or $3$.
A: $p + q-pq +1=0$ means $pq - q=p+1$ so $q=\frac {p+1}{p-1}$.
And $pq-p = q+1$ so $p =\frac {q+1}{p-1}$.
To solve $\frac {x+1}{x-1}\in \mathbb Z$, we can get $\gcd(x+1,x-1)= \gcd(x+1, (x+1)-(x-1)) = \gcd (x,2) = 1,2$  so $x-1=1,2$ (assuming $x-1 >0$) and $x+1=3,4$ and $x = 2,3$.
Alternatively we could have assigned $m = x-1$ and realized that $m|m+2$ so $m|2$ so $m = 1,2$
So $p$ and $q$ are equal to $2$ and $3$ and as $p > q$ we have $p=3; q=2$.
A: To focus narrowly on the question as posed: Having identified $2,3$ as a solution, how can you show that $2,3$ is the only solution? The  other answers show how to find that solution from scratch, and by the method finding it, that it will be unique. Those approaches are valid. This answer proves the uniqueness of the already known solution by assuming it is not unique.
Assume there is another solution with $p\ne 2$. Then $(p,q)\in \mathbb P \land q>p>2 \Rightarrow q-p\ge 2$ (odd primes always differ by $2$ or more).
Hence $q>p+1$ and $2q>p+q+1$
Therefore $pq>2q>p+q+1$, hence $p+q+1-pq<0$ and the assumption $p\ne 2$ cannot be true. All solutions must have $p=2$
If $p=2 \land q\ne 3$, the argument repeats with the variation $pq=2q>p+q+1$. So $p,q=2,3$ is the only solution.
A: Hint.
$p\mid (q+1)$
$q\mid(p+1)$
