Groups of order $n^2$ that have no subgroup of order $n$

I have a feeling that there is not much we can say in general, but here is an infinite family of examples.

Let $p$ be an odd prime such that $3$ divides $p+1$ (for example $p = 5$).

One example is $G = A_4 \times ((C_p)^2 \rtimes C_3)$, where the semidirect product is nontrivial. Then $G$ has order $(6p)^2$, but $G$ has no subgroup of order $6p$.

Proof: Let $H$ be a subgroup of order $6p$. Then $H$ has a subgroup of order $2$. Since any such subgroup is contained in the $A_4$ factor, it follows that $H \cap A_4$ has order divisible by $2$. Now $A_4$ has no subgroup of order $6$, so $H \cap A_4$ must have order $2$.

Now note that because $3$ does not divide $p-1$, any group of order $3p$ is cyclic. Thus $H$ contains an element of order $3p$. There is no such element in $(C_p)^2 \rtimes C_3$, so it must be of the form $xy$, where $x \in A_4$ has order $3$ and $y \in (C_p)^2 \rtimes C_3$ has order $p$. But then $x \in H \cap A_4$, a contradiction since $H \cap A_4$ has order $2$.


The above gives examples for $n = 30, 66, 102, 138, \ldots$

With GAP it is possible to check that $n = 28$ also gives examples, for example $\operatorname{SmallGroup}(784, 160)$ and $\operatorname{SmallGroup}(784, 162)$. I am not sure if there are any examples for smaller $n$.


Just to expand my comment, the smallest $n$ for which this occurs is $n=24$, and the single example of a group of order $24^2$ with no subgroup of order $24$ is ${\mathtt{SmallGroup}}(576,8661)$, a semidirect product $N \rtimes C_9$, where $N$ is elementary abelian of order $64$, and the $C_9$ acts irreducibly on $N$.

It is a Frobenius group of degree $64$ and can also be accessed as $\mathtt{PrimitiveGroup}(64,1)$.