TITLE: Number Theory with 2 primes
QUESTION [8 upvotes]: Find all $n \in \mathbb{Z^+}$ such that there exists primes $p,q$ such that:
$n=p(p^2-p-1)=q(2q+3)$

I tried working in $\mod 6$ and found that $n \equiv 3,5 \mod 6$. 
If $n$ is congruent to $3  \mod 6$ then both $p,q$ are congruent to $3 \mod 6$ which is a contradiction. So $n$ is congruent to $5 \mod 6$ and $p,q$ must be $\equiv 1,5 \mod 6$. Now we just find which $n$ are not possible.  Not sure how I can do that or if there is a solution that unravels all $n$ more easily.

REPLY [2 votes]: As @ΜάρκοςΚαραμέρης points out, the solutions here are (prime) integer coordinates on an elliptic curve, and general theory (Siegel's Thm.) tells us that for an irreducible cubic, there are at most finitely many integer points.  Getting the actual number of these can sometimes be a tedious computation, but in the present case we can get tight bounds with elementary methods (e.g. completing the square).
As noted in Comments by Keith Backman and others, the search for prime coordinates $(p,q)$ (which we assume positive for simplicity) of:
$$ p(p^2-p-1)=q(2q+3) $$
reduces to $p^2-p-1 = qk$ and $2q+3=pk$ (so $k\gt 0$) where:
$$ 2p^2 - (k^2 +2)p + (3k-2) = 0 $$
An integer solution $p$ of this quadratic equation requires $k$ that makes the discriminant a perfect square, i.e:
$$ m^2 = (k^2 + 2)^2 - 8(3k-2) $$
To bound these possible $k$ it suffices to notice that for sufficiently large $k$, the discriminant lies strictly between the two consecutive squares:
$$ (k^2 + 1)^2 \lt (k^2 + 2)^2 - 8(3k-2) \lt (k^2 + 2)^2 $$
The right hand inequality holds for $k\ge 1$, and to prove the left hand inequality we rewrite it as:
$$ 8(3k-2) \lt (k^2 + 2)^2 - (k^2 + 1)^2 = 2k^2 + 3 $$
$$ 0 \lt 2k^2 - 24k + 19 = 2(k-6)^2 - 53 $$
By inspection this last is true for all $k\ge 12$, so our search for solutions only needs to cover $k = 1,\ldots, 11$.  Of course this ground is already scoured, producing the only (positive) prime solution ($k=5, p=13, q=31$).