TITLE: Find all primes $p$ and $r$ such that $ pr+1+r^3=p^2 $
QUESTION [5 upvotes]: I tried some small values, and I found that $p=7$ and $r=3$ was a solution.
I ve also find a way to factorise the equation:
$$ p(p-r)=(r+1)(r^2-r+1)$$
Since  we know that $ p > r+1 $ then $$p| (r^2\color{blue}{-}r+1) $$
That's all what i've found , thank you in advance fo your precious help !

REPLY [4 votes]: As you've already noted,
$$p(p - r) = (r + 1)(r^2 - r + 1) \tag{1}\label{eq1A}$$
Also, there's a positive integer $k$ such that
$$p \mid (r^2 - r + 1) \; \; \to \; \; r^2 - r + 1 = kp \tag{2}\label{eq2A}$$
Similar to how Find all pairs of prime numbers $p$ and $q$ such that $\,p^2-p-1=q^3.$ that Dietrich Burde's question comment suggested is solved, substitute \eqref{eq2A} into \eqref{eq1A} and divide both sides by $p$ to get
$$p - r = (r + 1)k \; \; \to \; \; p = (r + 1)k + r \; \; \to \; \; p = (k + 1)r + k \tag{3}\label{eq3A}$$
Substituting this into \eqref{eq2A} gives
$$\begin{equation}\begin{aligned}
& r^2 - r + 1 = k((k + 1)r + k) \\
& r^2 - r + 1 = (k^2 + k)r + k^2 \\
& r^2 + (-k^2 - k - 1)r + (1 - k^2) = 0
\end{aligned}\end{equation}\tag{4}\label{eq4A}$$
This is a quadratic equation in $r$, so the quadratic formula gives
$$r = \frac{k^2 + k + 1 \pm \sqrt{(-k^2 - k - 1)^2 - 4(1 - k^2)}}{2} \tag{5}\label{eq5A}$$
For $r$ to be integral requires the discriminant (note I use $(-k^2 - k - 1)^2 = (-(k^2 + k + 1))^2 = (k^2 + k + 1)^2$ for convenience), i.e.,
$$\begin{equation}\begin{aligned}
d & = (k^2 + (k + 1))^2 - 4(1 - k^2) \\
& = k^4 + 2k^2(k + 1) + (k + 1)^2 - 4 + 4k^2 \\
& = k^4 + 2k^3 + 2k^2 + k^2 + 2k + 1 - 4 + 4k^2 \\
& = k^4 + 2k^3 + 7k^2 + 2k - 3
\end{aligned}\end{equation}\tag{6}\label{eq6A}$$
must be the square of an integer. Consider the values of $k$ for which
$$(k^2 + k + 2)^2 = k^4 + 2k^3 + 5k^2 + 4k + 4 \lt d \lt (k^2 + k + 3)^2 = k^4 + 2k^3 + 7k^2 + 6k + 9 \tag{7}\label{eq7A}$$
is true. With the first inequality, we get
$$\begin{equation}\begin{aligned}
k^4 + 2k^3 + 5k^2 + 4k + 4 & \lt k^4 + 2k^3 + 7k^2 + 2k - 3 \iff \\
5k^2 + 4k + 4 & \lt 7k^2 + 2k - 3 \iff \\
-2k^2 + 2k & \lt -4 - 3 \iff \\
-2k(k - 1) & \lt -7
\end{aligned}\end{equation}\tag{8}\label{eq8A}$$
This is true for all $k \ge 3$. Note the second inequality in \eqref{eq7A} is true for all positive $k$. Thus, \eqref{eq7A} holds for all $k \ge 3$. This means $d$ is between two consecutive perfect squares and, thus, can't be a perfect square itself, so we must have $k \lt 3$.
With $k = 1$, \eqref{eq6A} gives $d = 9$, so \eqref{eq5A} gives $r = 0, 3$, with only $r = 3$ being valid. In \eqref{eq2A}, this gives $p = 7$, as you've already determined. Next, using in $k = 2$ in \eqref{eq6A} gives $d = 61$, which is not a perfect square.
This means there's only the one solution you've already found, i.e., $p = 7$ and $r = 3$.

REPLY [2 votes]: Partial answer: I haven't proven it, but I made enough progress that I feel it is worth sharing.

You have
$$r(r^2+p)=p^2-1=(p-1)(p+1)$$
which implies that $r|p-1$ or $r|p+1$. Assume it is the first case: then $p=rk+1$ for some natural $k$. This gives us
$$0=r^2+\left(k-k^2\right) r-2 k+1$$
Solving this gives
$$r=\frac{1}{2} \left((k-1) k+\sqrt{k \left(k (k-1)^2+8\right)-4}\right)$$
(we can ignore the other root since it is always negative). Since this has to be an integer, we know
$$\frac{\sqrt{k \left(k (k-1)^2+8\right)-4}}{2}\in\mathbb{N}$$
At this point, you could finish the proof by showing that this relation is only satisfied by a finite number of $k$ and then doing something similar for $p=rk-1$.