We have:
{pqr=n(p+1)(q+1)r=n+138}⇔{pqr=npqr+(p+q)r+r=n+138}⇔{pqr=n(p+q+1)r=138}.
From equation
(p+q+1)r=138=2⋅3⋅23(1)
we will determine the possible values of p, q, r and in the sequel from the equation pqr=n. We will find all the possible values of n.
Since p, q, r are primes, the possible values of r are 2 or 3 or 23, and therefore we have the cases:
* If r=2, then p+q+1=69⇔p+q=68, and hence, (p,q primes) we find the pairs
(p,q)=(7,61),(p,q)=(61,7),(p,q)=(31,37),(p,q)=(37,31).
Hence for the product pqr=n we obtain the values:
n=7⋅61⋅2=854 or n=31⋅37⋅2=2294.
* If r=3, then p+q+1=46⇔p+q=45, and hence:
(p,q)=(2,43),(p,q)=(43,2)⇒n=2⋅43⋅3=258.
* If r=23, then
p+q+1=6⇔p+q=5⇔(p,q)=(2,3) or (p,q)=(3,2),
and hence n=2⋅3⋅23=138.
Therefore the possible values of n are: 138, 258, 854 και 2294.