21. Find $p$, if each of the numbers $p, 2p+1$, and $4p+1$ is prime.
21. The number $p$ can be represented in one of three forms: $3 k, 3 k+1$ or $3 k+2$. For $p=3 k+1$, we have:

$2 p+1=2(3 k+1)+1=6 k+3=3(2 k+1)$ - a composite number. For $p=3 k+2$, we have:

$4 p+1=12 k+9=3(4 k+3)$ - a composite number.

Fig. 12

![](https://cdn.mathpix.com/cropped/2024_05_21_00604dc020e3721fc1f4g-145.jpg?height=826&width=817&top_left_y=221&top_left_x=631)

If $p=3 k$, then only when $k=1$ is the number $p$ prime. This number is $p=3$. Then $2 p+1=7$ and $4 p+1=13$ are also prime numbers. Therefore, when $p=3$, all three numbers are prime.