My question is as follows:
Let $G$ be an arbitrary finite group. Let $n_r(G) \in \mathbb{N}_0$ be the amount of elements that have exactly order $r \geq 2$ in $G$. For which numbers $k \in \mathbb{N}_0$ can we find/construct groups $G$ such that $n_r(G) = k$? For $k$ such that it is possible, can one find representatives only constructed using cyclic groups and semidirect (including direct) products? What about if we drop the finiteness requirement?
Disclaimer: My knowledge about Group Theory extends to about that of a first course in Abstract Algebra (Quotient Groups, Group Actions, Sylow theorems, Solvability) and I have just begun trying to understand semidirect products and getting used to GAP. Feel free to call me out on any nonsense I may write.
As already discussed in this question debating the existence of a group with exactly $68$ resp. $92$ elements of order $3$, this question is highly non-trivial for the case $r \neq 2$ (but affirmative if $r = 2$ by using dihedral groups). I have been able to deduce from this post that for $p$ prime we have $$n_{p} \equiv p-1 \mod p(p-1)$$ by a result of Frobenius ($n_p = p-1 \mod p$) and using that every element (except $e)$ has order $p$ in element-generated subgroups of size $p$ (such that $n_p \equiv 0 \mod p-1$). This weeds out the cases we must check dramatically, e.g. we have $$n_3 \equiv 2 \mod 6 \text{ and } n_5 \equiv 4 \mod 20 \text{ and } n_7 \equiv 6 \mod 42 \ldots$$
For a given prime $p$ and $m \in \mathbb{N}$, we can obviously cover the cases $n_p = p^m-1$ with the group $(\mathbb{Z}_p)^m$ - the $m$-times iterated direct product of $\mathbb{Z}_p$. But for everything in between, it always has involved guess work and pattern spotting from my side. The reason why I ask if this can be done with cyclic groups and semidirect products only is simple: I used GAP to search for the smallest groups $G$ that have the property $n_r(G) = k$ and in all - except one - examined cases it has always spat out a combination of cyclic groups by (semi)direct products.
Now, since the linked question answers the stated premise negatively, we obviously cannot realise all these possibilities given by above condition. Specifically, I constructed a table with small primes and their conjectured non-realisible numbers:
$$\begin{array}{c|c} p & k \in \mathbb{N}: ?\exists G: n_p(G) = k \text{ gives no output from GAP} \\ \hline 3 & \require{enclose}\enclose{horizontalstrike}{68}, \require{enclose}\enclose{horizontalstrike}{92}^*, 110,140,164,176,212,230,236,260,\ldots \\ 5 & 84, 104, 144, 204, 224, 244, 264, 304, 324,\ldots \\ 7 & 90, 132, 216, 300, 468, \ldots \\ 11 & 340, 450, 560,\ldots \end{array}$$
*As pointed out by spin in the comments.
A crossed out number in this table means that one provably cannot find such a group, I still include it to keep it consistent with the (non-existing) output of my small GAP program. Also keep in mind that this table could include some false negatives since I cannot search with GAP for obscenely large groups that might fulfill the given property (or straight up do not exist as in the case $n_3 = 68$). This brings us back to the following thoughts: Are these truly not realisable? What general families of realisable groups do exist? Are there notable exceptions of realizations?... as possible jumping off points to attacking the question.
Bonus question: Can you point me to literature references that have worked on this and related questions?
Thank you for listening to my ramblings about Group Theory :^).