I am looking for finite groups $G$ such that the number of subgroups is equal to $|G|$. Examples are:
the trivial group
$\mathbb{Z}/2\mathbb{Z}$
$S_3$
Does anyone know some more examples or can provide some insight? Are there any bounds on the number of subgroups (maybe using Sylow's theorems or whatever)?
Here is list of all examples $\leq 100$, found with GAP (EDIT: I added some more, but I didn't check for groups of order $128$). The notation $:$ means semidirect product.
$$\begin{array}{|c|c|} \text{StructureDescription} & \text{Order} \\ \hline \text{Trivial group} & 1 \\ \hline C_2 & 2 \\ \hline S_3 & 6 \\ \hline C_4 \times C_2 & 8 \\ \hline D_{28} & 28 \\ \hline C_6 \times S_3 & 36 \\ \hline (C_{10} \times C_2) : C_2 & 40 \\ \hline C_2 \times (C_5 : C_4) & 40 \\ \hline (C_3 \times Q_8) : C_2 & 48 \\ \hline ((C_3 \times C_3) : C_3) : C_2 & 54 \\ \hline C_6 \times A_4 & 72 \\ \hline C_2 \times ((C_4 \times C_4) : C_3) & 96 \\ \hline (C_5 \times C_5) : C_4 & 100 \\ \hline D_{104} & 104 \\ \hline S_3 \times D_{22} & 132 \\ \hline C_3 \times D_{48} & 144 \\ \hline (C_{40} \times C_2) : C_2 & 160 \\ \hline (C_5 \times (C_8 : C_2)) : C_2 & 160 \\ \hline ((C_2 \times (C_5 : C_4)) : C_2) : C_2 & 160 \\ \hline (C_4 \times (C_5 : C_4)) : C_2 & 160 \\ \hline (C_{40} \times C_2) : C_2 & 160 \\ \hline (C_8 \times D_{10}) : C_2 & 160 \\ \hline (C_2 \times (C_5 : Q_8)) : C_2 & 160 \\ \hline (C_2 \times (C_{11} : C_4)) : C_2 & 176 \\ \hline (C_{15} \times C_3) : C_4 & 180 \\ \hline \end{array}$$
Random related fact: the number of subgroups in the dihedral group $D_n$ of order $n$ is $\sigma(n/2) + d(n/2)$, where $\sigma$ is the sum of divisors function and $d$ is the divisor count function. Thus the dihedral group $D_n$ of order $n$ is an example for the problem when $$n = 2,\ 6,\ 28,\ 104,\ 260,\ 368,\ 1312,\ 17296,\ 24016,\ 69376,\ \ldots$$
I don't know if this sequence is infinite. For more terms, it is $2 \cdot$ $A083874$ from OEIS. Seems that really large examples exist, for example $9223653647124987904$ is in the sequence.