When does a finite group $G$ have an element of order equal to its exponent? The following question came up to my mind while I was playing with the exponent. There is no other motivation except plain curiosity:
Question. If $G$ is a finite group, denote by $e(G)$ its exponent. Can we characterize finite groups $G$ which have an element of order $e(G)$ ?
Examples and non examples.

*

*An abelian group $G$ has an element of order $e(G)$


*A $p$-group has an element of order $e(G)$


*More generally (as pointed out by @Brauer Suzuki), a finite nilpotent group $G$ has an element of order $e(G)$


*A non cyclic group $G$ whose Sylow subgroups are cyclic (eg $D_n$ for $n$ odd) has no element of order $e(G)$. Indeed, in this case, $e(G)=\vert G\vert$.


*For any $e\geq 1$ and any finite group $H$ such that $e(H)\mid e,$ $G=H\times \mathbb{Z}/e\mathbb{Z}$ has an element of order $e(G)$


*Finite groups $G$ satisfying the required property are not necessarily isomorphic to $H\times \mathbb{Z}/e(G)\mathbb{Z}$ for  some suitable $H$, since the Heisenberg group of order $p^3$ is a counterexample.
Because of the last three items, I do not expect the answer to be easy (it is plausible that there is no satisfactory answer), but I am not an expert in group theory, so maybe there is a nice  characterization in terms of linear representations, for example ? or in terms of derived subgroup ?
 A: This is a partial answer to the question.
As remarked by @Brauer Suzuki, finite nilpotent groups $G$ have an element of order $exp(G)$. The same goes for all the sections of $G$: a section of $G$ is a group $H/K$, such that $K \unlhd H \leq G$. Now define
$$\varphi(G)=\#\{g \in G: o(g)=exp(G)\}.$$
Since for a cyclic group $G \cong C_n$ of order $n$, this number equals $\varphi(n)$, the above number can be seen as a generalization of the Euler Totient function. Now, if $G$ is finite and nilpotent, then $\varphi(G) \neq 0$, and for all sections $S$ also $\varphi(S) \neq 0$. There is a remarkable theorem of $M. T\check{a}rn\check{a}uceanu$ (see here) that asserts that the converse is also true.
Theorem (M. Tarnauceanu, 2018) Let $G$ be a finite group. Then $G$ is nilpotent if and only if $\varphi(S) \neq 0$ for every section $S$ of $G$.
A: Here are some examples that put severe limits on what you can expect, in my opinion.
Example 1: Let $G$ be any finite group and let $k$ be the number of prime factors of $|G|$. Then the cartesian product $G^k$ has an element of order $\exp(G) = \exp(G^k)$. Indeed, let $g_1, \dots, g_k \in G$ be elements realising the maximal prime power orders in $G$. Then $(g_1, \dots, g_k)$ has order $\exp(G)$.
Note this generalizes the $p$-group example. The following example is similar.
Example 2: $G = \operatorname{SL}_2(p)^3$ for any prime $p$. Indeed, $\operatorname{SL}_2(p)$ has elements of order $p-1$, $p$, and $p+1$, so $G$ has an element of order $\operatorname{lcm}(p-1, p, p+1) = \exp(G)$.
A: Just one more source of (non-)examples: The groups with the desired property have a complete prime graph (not an "if and only if" though). I don't know want Dereck Holt deleted comments was, but I guess it was about simple groups. The prime graphs of simple groups are known, although I did not find an explicit claim about their connectedness.
A: Some small observations, too long for a comment.
Let $G$ be a finite group of order $n$ with prime factorization $n = p_1^{k_1} \cdots p_t^{k_t}$. Let $P_i$ be a Sylow $p_i$-subgroup of $G$.
Then $\exp(G) = \exp(P_1) \cdots \exp(P_t)$. The proof is an exercise. This was basically noted in one of the other answers, it follows then that the direct product $G^t = G \times \cdots \times G$ ($t$ times) contains an element of order $\exp(G^t) = \exp(G)$.
So the exponent is determined by the structure of the Sylow subgroups of $G$. Whether there exists an element of order $\exp(G)$ depends on the centralizers of elements of order $\exp(P_i)$.
For example, consider $|G|= p_1^{k_1} p_2^{k_2}$. Then $G \times G$ contains an element of order $\exp(G \times G) = \exp(G)$. And $G$ contains an element of order $\exp(G)$ if and only if for some $x_1 \in P_1$ of order $\exp(P_1)$, the centralizer $C_G(x_1)$ contains an element of order $\exp(P_2)$.
