Task B-3.4. Determine non-negative integers $p$ and $n$ such that all numbers $p$, $p+3^{n}, p+3^{n+1}, p+3^{n+2}, p+3^{n+3}$ are prime.
## Solution.

The numbers $3^{n}, 3^{n+1}, 3^{n+2}, 3^{n+3}$ are odd numbers, so if we add an odd number $p$ to them, we will get an even number, which means that $p$ must be even. Since $p$ must be a prime number, the only possibility is $p=2$.

We consider the sequence of numbers

$$
2, \quad 2+3^{n}, \quad 2+3^{n+1}, \quad 2+3^{n+2}, \quad 2+3^{n+3}
$$

The powers $3^{n}, 3^{n+1}, 3^{n+2}, 3^{n+3}$ end in (some order) the digits 1, 3, 7, 9. If one ends in 3, adding the number 2 will result in one of the terms ending in 5, which means it is divisible by 5 and thus not prime, except in the case of $n=0$ or $n=1$.

The desired sequence of numbers is $2,5,11,29,83$ or $2,3,5,11,29$.