In PEN (Problems in Elementary Number Theory) Project, there is a problem A111 as follows
Find $n$ if $n(n+1)(n+2)(n+3)$ has exactly three distinct prime divisors.
It's easy to see that at least 2, 3 should be two of the prime divisors of $n(n+1)(n+2)(n+3)$, and I think there are infinitely many $n$ satisfying the above property, but I haven't found out the general answer.
Please help me.
Thanks.
First not ethat $n=1$ is only almost a solution as $n(n+1)(n+2)(n+3)$ has only two prime divisors. Hence we ma assume $n>1$.
Let $p$ denote the third prime.
If $n$ is a multiple of $3$, then so is $n+3$. Then $n+1, n+2$ are divisible only by $2$ and $p$, and non of them is divisible by both. In other words, we have either $$\tag1 n=3^a,\quad n+1=2^b,\quad n+2=p^c,\quad n+3=2^k3^d$$ or $$\tag2 n=2^k3^a,\quad n+1=p^c,\quad n+2=2^b,\quad n+3=3^d.$$ Note that one of $a,d$ must be $=1$, and one of $b,k$ must be $=1$. This boils down to the following variants:
Next, assume that $n$ is not a multiple of $3$. Then exactly one of the four numbers is a multiple of $2$, exactly two are multiples of $2$ and exactly one is a multiple of $p$. To cover four numbers this way, we must have that each of the for numbers is a prime power. In particular, the two powers of $2$ must be $2$ and $4$. This leaves us with $n=2$, $n+1=3$, $n+2=4$, $n+3=5$, which is a solution.
In summary, $n$ is a solution iff $$ n\in\{2,3,6\}.$$