An element is nilpotent in $\mathbb{Z}/n\mathbb{Z}$ if and only if all prime divisors of $n$ divide the element.
If $n = p_1^{a_1} ... p_r^{a_r}$ the set of nilpotents of $\mathbb{Z}_n$ is $(p_1 p_2 ... p_{r-1} p_r)\Bbb Z_n$