Let $H$ be a finite group of order $n$ with the property that for every $d\mid n, x^d = 1$ has at most $d$ solutions. Then $H$ is cyclic.
Let $\alpha = \{h'_1, h'_2, ..., h'_k\}$ be the set of all orders of elements. If $n \in \alpha$ done. Assume $n \notin \alpha.$ Consider $\mathrm{lcm}(h'_1, ..., h'_k) = h'.$ We know that there exists an element $g$ such that $o(g) = h'.$ Since $n \notin \alpha, h' \neq n.$ Hence, we have that for all $x \in H, x^{h'} = 1.$ However, we have $n$ solutions where $h' < n.$ Contradiction. It must be that $n \in \alpha.$
Does this work?