I'm trying to show that $\mathbb{Z}_n$ has a nonzero nilpotent element if and only if $n$ is divisible by the square of some prime.
I have figured out the proof of showing that if $n$ is divisible by the square of a prime, then there is a nonzero nilpotent element. I'm having trouble with the other direction.
Start: If there exists a nonzero nilpotent element $a$, then $n$ does not divide $a$, but $n$ divides $a^k$ for some positive integer $k$....Hint?
Saying $n \mid a^k$ implies that $\{$ prime divisors of n $\} \subset \{$ prime divisors of $a^k\} = \{$ prime divisors of a $\}$
Assume now that $n$ has only simple prime divisors, and wonder if it is actually possible that $n \mid a^k$ without $n \mid a$ holding