Trick: The shortest approach, in an MCQ scenario would be to work out $P^2$ for a few basic matrices.
That is, for $n=2$, $P^2$ would not be a zero matrix.
For $n=3$, the matrix $P$ according to the prescribed condition is
$$\begin{bmatrix}
\omega^2 & 1 & \omega \\
1 & \omega & \omega^2 \\
\omega & \omega^2 & 1 \\
\end{bmatrix}$$
Using basic matrix multiplication and applying the identity $1+\omega+\omega^2=0$, it is easily seen that $P^2$ is the zero matrix.
Keeping this in mind, we can infer a general rule:
for $n \ne 3m, m\in \mathbb N\implies P^2 \ne 0$
From this you can workout the options.