Dihedral group $D_n$ is nilpotent iff $n=2^i$

I want to show that the dihedral group $D_n$ is nilpotent if and only if $n=2^i$ for some $i$.

I have shown the direction $\Leftarrow$.

Could you give me some hints for the direction $\Rightarrow$ ?

We suppose that $D_n$ is nilpotent and $n=2^im$, where $2\not\mid m$, or not?

How can we find a contradiction?

Hint :

A nilpotent group is a direct product of its sylow subgroups.

If the size of the order of a nilpotent group has an odd prime factor, the size of its center also has an odd prime factor. This follows from the fact that every $p$-group has a center with a size divisible by $p$.

Now show, that every dihedral group has a center of size $1$ or $2$.

• and so I can conclude that the only Sylow subgroups used to build $D_n$ are related to the prime $2$, from which I conclude $|D| = 2^k$? – RGS Jan 25 '18 at 14:55