TITLE: Subgroup of the semidirect product of two elementary abelian subgroups
QUESTION [5 upvotes]: Let $H$ and $K$ be two abelian groups. It is well known that a
subgroup of the semidirect product $H\rtimes K$ is not in general
semidirect product of two subgroups $H'\le H$ and $K'\le K$. But if
$G'$ is a subgroup  of $H\rtimes K$  such that $K\le G'$, then
$G'\simeq (G'\cap H)\rtimes K$ (see
Subgroup).
How can one use this for the following problem:
Let $G$ be a nonabelian $p$-group of order $p^{m+1}>p^{3}$ such that
$G\simeq(\mathbb{Z}/p\mathbb{Z})^{m}\rtimes(\mathbb{Z}/p\mathbb{Z})$.
Note that every subgroup of $G$ contains a subgroup of oder $p$. 

Is there a nonabelian subgroups of $G$ of the form $(\mathbb{Z}/p\mathbb{Z})^{k}\rtimes(\mathbb{Z}/p\mathbb{Z})$  with
$1<k<m$ ?.

If the answer is yes, what is the number of nonabelian subgroups of index $p^{n}$ in $(\mathbb{Z}/p\mathbb{Z})^{m}\rtimes(\mathbb{Z}/p\mathbb{Z})$ (we can consider that $(\mathbb{Z}/p\mathbb{Z})^{m}\rtimes (\mathbb{Z}/p\mathbb{Z})$ is of maximal class). 


Any help would be appreciated so much. Thank you all.

REPLY [3 votes]: Yes, there always exists such a subgroup. Let $g$ be a generator of the complement $K$ of order $p$ in the semidirect product, and let $h$ be an element in the normal subgroup $H$ that lies in $Z_2(G) \setminus Z(G)$. Then $\langle g,h \rangle = \langle [h,g],h \rangle \rtimes \langle g \rangle$ is nonabelian of order $p^3$.