Find all primes $(p,q)$ such that $pq$ divides $p^3 + q^3 +1$ The question is

Find all primes $(p,q)$ such that $pq$ divides $p^3 + q^3 +1$.

My attempt:
This reduces to finding primes $p,q$ such that p divides $q^3+1=(q+1)(q^2-q+1)$ and q divides $p^3+1=(p+1)(p^2-p+1)$.
Now we have 4 cases: If p divides $q+1$ and q divides $p+1$, then $\{p,q\}=\{2,3\}$.
I don't know how to deal with the other cases. For example, what happens if p divides $q+1$ and q divides $p^2-p+1$?
 A: If $p \mid q+1$ and $q \mid p^2-p+1$, then $\frac{p^2-p+1}q$ must be $-1$ modulo $p$, since $q\equiv -1\pmod p$. As a result, there exist positive $m,n$ for which
$$(mp-1)(np-1)=p^2-p+1.$$
We clearly can't have $m=n=1$, so we must have
$$(p-1)(2p-1)\leq (mp-1)(np-1)=p^2-p+1\implies p\leq 2,$$
and thus $(2,3)$ is the only solution here as well. The same goes for if $p$ and $q$ are swapped.
For the final case, we claim that $a \mid b^2-b+1$ and $b \mid a^2-a+1$ has no solutions in positive integers besides $(a,b)=(1,1)$. To show this, assume for the sake of contradiction that there exists such a pair with minimal sum, and without loss of generality assume $a>b$. Now, consider
$$c=\frac{b^2-b+1}a.$$
Since $b>1$ (as otherwise $a=b=1$), $c<a$, so $b+c<a+b$. However, $c \mid b^2-b+1$, and
$$c^2-c+1\equiv \frac1{a^2}-\frac1a+1\equiv \frac{a^2-a+1}{a^2}\equiv 0\pmod b$$
(using that $\gcd(a,b)=1$), so $b \mid c^2-c+1$ as well. Then $(b,c)$ is a pair satisfying the conditions with smaller sum than $(a,b)$, a contradiction. So, not only can there not exist primes $(p,q)$ with $p \mid q^2-q+1$ and $q \mid p^2-p+1$, there can't exist any such pairs of positive integers.
A: If $q\mid p^2-p+1$ and $p\mid q+1$ (so $p\leq q+1$) then $$pq\mid  (p^2-p+1)(q+1)\implies pq\mid p^2-p+1 +q$$
From here we get $$pq\leq  p^2-p+1 +q\implies q\leq {p^2-p+1\over p-1} <p+1$$
So $p=q+1$ if $p>2$ and now is easy to finish.
A: $Solution\ :$
\begin{gather}
So,\ given \notag\\
p^{3} +q^{3} +1\ \equiv 0\bmod pq \notag\\
And\ we\ know\ that, \notag\\
( a+b+c)^{3} -a^{3} -b^{3} -c^{3} =3\cdotp ( a+b)( b+c)( c+a) \notag\\
 \notag\\
So,\ a^{3} +b^{3} +c^{3} =( a+b+c)^{3} -3\ ( a+b) \ ( b+c) \ ( c+a) \notag\\
 \notag\\
\therefore p^{3} +q^{3} +1\ \equiv 0\bmod pq \notag\\
\Longrightarrow ( p+q+1)^{3} -3\ ( p+1)( q+1)( p+q) \equiv 0\bmod pq\ ....(1)\\
 \notag\\
So,\ p^{3} +q^{3} \ can\ be\ written\ as\ ( p+q)\left( p^{2} -pq+q^{2}\right) \notag\\
In\ the\ modulo\ form,\ ( p+q)\left( p^{2} -pq+q^{2}\right) +1\equiv 0\bmod pq \notag\\
And\ ( p+q)\left( p^{2} -pq+q^{2}\right) \equiv -1\bmod pq\ ....(2)\\
 \notag\\
So\ we\ have\ four\ cases,\  \notag\\
Case\ I\ :\ ( p+q) \equiv -1\bmod pq \notag\\
Case\ II\ :\ \left( p^{2} -pq+q^{2}\right) \equiv -1\bmod pq \notag\\
\\
Taking\ both\ the\ cases\ separately. \notag
\end{gather}
$ \begin{array}{l}
Case\ I:\\
\\
( p+q) \equiv -1\bmod pq
\end{array}$
\begin{gather*}
We\ see\ that\ p+q+1\equiv 0\bmod pq\\
So\ we\ have\ ( p+q) \equiv -1\bmod pq,\ Substituting\ this\ in\ ( 1)\\
We\ get,\ ( 0)^{3} -3\ ( p+1)( q+1)( -1) \equiv 0\bmod pq\\
\Longrightarrow 3\ ( p+1)( q+1) \equiv 0\bmod pq\ \\
( If\ we\ again\ substitute\ \ p+q\equiv -1\bmod pq,\ we\ get\ 3( -p)( -q) \equiv 0\bmod pq)\\
So\ even\ after\ substituting\ p+q\equiv -1\bmod pq,\\
We\ get\ the\ remaining\ product\ again\ as\equiv 0\bmod pq.\\
So\ we\ can\ write\ 3( p+1)( q+1) =pq\cdotp k\\
So\ again\ we\ have\ two\ cases,\\
\ i) \ 3\mid pq,\ \&\ ii) \ When\ 3\mid k\ 
\end{gather*}
$ \begin{array}{l}
Case\ ( i)\\
\\
 When\ 3\mid pq,\ 
\end{array}$
\begin{gather*}
So,\ If\ 3\mid pq,\ then\ either\ p=3\ or\ q=3,\ since\ both\ are\ prime.\\
So\ let\ p=3.\ Then,4( q+1) =qk.\\
Since\ q+1\nmid q\Longrightarrow q+1\mid k.\ Also,\ we\ know\ 4\mid qk.\\
If\ 4\mid k,\ then\ 4( q+1) \mid k\Longrightarrow y=1,\ which\ leads\ to\ a\ contradiction\ as\ 1\ is\ not\ a\ prime.\\
Thus,\ we\ must\ have\ 2\mid q\ and\ 2\mid k.\\
This\ leads\ to\ the\ solutions\ ( p,q) \equiv \ ( 3,2) \ and\ ( 2,3) \ ( by\ symmetry) .
\end{gather*}
$ \begin{array}{l}
Case\ ( ii)\\
\\
When\ 3\mid k,\ 
\end{array}$
\begin{gather}
So,\ if\ 3\mid k\ \Longrightarrow 3m=k, \notag\\
\therefore 3\ ( p+1)( q+1) =pq\cdotp k\equiv ( p+1)( q+1) =pq\cdotp m \notag\\
And\ we\ also\ know\ p+1\nmid p\Longrightarrow p+1\mid qm,\ and\ we\ can\ write\ it\ as,( p+1) \ n=qm. \notag\\
\Longrightarrow q+1=p\cdotp n\ \equiv p\mid ( q+1) \ and\ by\ symmetry\ we\ can\ say\ q\mid ( p+1) . \notag\\
 \notag\\
Now\ we\ can\ see\ that\ as\ both\ p\ and\ q\ are\ primes,\ and\ q\leqslant p+1\ and\ p\leqslant q+1.\ ....(3)\\
From\ ( 3) \ we\ get\ that\ p\ and\ q\ should\ be\ consecutive\ to\ hold\ the\ inequality. \notag\\
( OR) \notag\\
And\ if\ q\ is\ an\ odd\ prime\ then, \notag\\
p\ should\ be\ 2\ from\ p\mid ( q+1) \ and\ q\ should\ be\ 3\ from\ q\mid ( p+1) . \notag\\
And\ if\ q=2\ then\ p=3. \notag\\
This\ leads\ to\ the\ solutions\ ( p,q) \equiv \ ( 3,2) \ and\ ( 2,3) . \notag
\end{gather}
$And\ even\ ( 2,3) \ satisfies\ \left( p^{2} -pq+q^{2}\right) \equiv 1\bmod pq$
$ \begin{array}{l}
Case\ II:\\
\\
\left( p^{2} -pq+q^{2}\right) \equiv -1\bmod pq
\end{array}$
\begin{gather}
We\ have\ \left( p^{2} -pq+q^{2}\right) \equiv -1\bmod pq,\ and\ adding\ 3pq \notag\\
we\ get,\ p^{2} +2pq+q^{2} \equiv -1\bmod pq\Longrightarrow ( p+q)^{2} \equiv -1\bmod pq\\
So,\ we\ get\ ( p+q)^{2} \equiv -1\bmod pq,\ ....(4) \notag\\
now\ looking\ eq\ ( 2) \ we\ see\ that\ if\ \left( p^{2} -pq+q^{2}\right) \equiv -1\bmod pq, \notag\\
then\ this\ must\ be\ ( p+q) \equiv 1\bmod pq,\ squaring\ both\ sides\ we\ get, \notag\\
( p+q)^{2} \equiv 1\bmod pq\ ....(5)\\
from\ eq\ ( 3) \ and\ ( 4) \ we\ get \notag\\
\left( p^{2} -pq+q^{2}\right) \equiv -1\bmod pq,\ have\ No\ solution. \notag
\end{gather}
Conclusion: Only $(2,3)$ is the solution
\begin{equation*}
\end{equation*}
