TITLE: Are twin primes the only solution to this equation?
QUESTION [5 upvotes]: Let $p,q_i, i \ge 1$ be primes, $m$ a positive integer. 
The equation
$$
p.\prod_{i=1}^m(q_i-1)-(p-1).\prod_{i=1}^mq_i=2
$$ 
for $m=1$ has all twin primes $p,q_1=p+2$ as solution.
Are there solutions for all $m\ge2$ ?

REPLY [4 votes]: Given an odd prime $p$ and integer $m \geq 2$, we can set $q_1=p+2$ and then, for each $i$ with $2 \leq i \leq m$,
$$
q_i = \frac{ 4+ (p-1) \prod_{j=1}^{i-1} q_j}{2}.
$$
One can check that
$$
p \cdot \prod_{i=1}^m (q_i-1) - (p-1) \cdot \prod_{i=1}^m q_i =2,
$$
and each $q_i$ is a polynomial in $p$, of degree $2^{i-1}$ (with coefficients in $\mathbb{Z}[1/2^{i-1}]$).
It is plausible that this construction should produce infinitely many values of $p$ for which $p$ and each $q_i$ are simultaneously prime. That being said, I may be missing some local obstruction. While this very likely leads to infinitely many examples for $m \in \{ 2, 3, 4 \}$, the smallest with $m=4$ being
$$
(p,q_1,q_2,q_3,q_4)=(3,5,7,37,1297),
$$
examples with $m=5$ are rather thinner on the ground : the smallest is with $p=512351711$.