Solution:
The equation rearranges to be
pn=2x(x+5)−3(x−1)=2x2+7x+3=(2x+1)(x+3).
Since x is a non-negative integer, both factors (2x+1) and (x+3) must be positive integers. Therefore both (2x+1) and (x+3) are both powers of p. Let
2x+1=pa
x+3=pb.
Now note that gcd(2x+1,x+3)=gcd(x−2,x+3)=gcd(5,x+3) which must equal either 1 or 5 (because 5 is prime). We consider each case individually:
If gcd(2x+1,x+3)=5 then p=5 and min(a,b)=1. Thus either 2x+1=5 or x+3=5. Either way we get x=2. This leads to pn=25 and so (x,p,n)=(2,5,2).
If gcd(2x+1,x+3)=1 then min(a,b)=0. Thus 2x+1=1 or x+3=1. So either x=0 or x=−2. We can't have x<0 so we must have x=0. This leads to pn=3 and so (x,p,n)=(0,3,1).
Therefore the only solutions for (x,p,n) are (2,5,2) and (0,3,1).