Can we construct a group with exactly $k$ Sylow-Subgroups? Inspired by the answers given by these three questions (here, here, and here), what is the general solution for constructing a group with a specific number of Sylow subgroups?

That is, given a prime $p$ and a positive integer $n\equiv1\pmod p$, is it always possible to construct a group $G$ with exactly $n$ subgroups of order $p$?

For example, is it possible to construct a group with exactly $15$ subgroups of order $7$, or exactly $35$ subgroups of order $17$?
From Hölder's Theorem (Theorem 19 here), if there is at least one prime $q \mid n$ such that $q \neq 1\pmod p$, then we can conclude that $g=|G|$ cannot be squarefree.
At the same time, it is not a necessary condition that every prime $q\mid n$ is congruent to $1\pmod p$.
In our example with $n=15$ and $p=7$, we know that $g$ cannot be square-free. From the Sylow Theorems, $np \mid g$, so $g$ is a multiple of $105$. However, $g$ is at least $315$ because of the requirement that $g$ must not be square-free. That is as far as I can get with constructing such groups.
Edit:
Derek's answer suggests that the answer to my original question is false in general. That is, it is not always possible to construct a group with $n$ subgroups of order $p$, even when $n$ is restricted to $1\pmod p$.
How would one prove this?
Secondly, under what conditions would there exist a group with exactly $n$ $p$-Sylow subgroups?
 A: No, there is no  finite group with exactly $15$ Sylow $7$-subgroups.
Let $G$ be the image of such a group in $S_{15}$ under the conjugation action of the group on its Sylow $7$-subgroups.
Then $G$ would be a transitive group of degree $15$ with order divisible by $7$.
There are databases of the transitive groups of degree $n$ for small $n$ available in GAP and Magma. From these, we find that there are $104$ transitive groups of degree $15$ (up to conjugation in $S_{15}$), but only four of these have order divisible by $7$ (numbers 47, 72, 103, and 104), and you can check by computer that none of these group have exactly $15$ Sylow $7$- subgroups - in fact these numbers are 120,
960, 370656000, and 370656000.
I expect this could be proved without using computers, but I will leave that to someone else!
A: For a prime $p$ and finite group $G$, let $n_p(G)$ be the number of Sylow $p$-subgroups of $G$.
By Sylow's theorem we know that $n_p(G) \equiv 1 \pmod{p}$. Your question is whether for any integer $n \equiv 1 \pmod{p}$ there exists a finite group $G$ such that $n_p(G) = n$.
For $p = 2$ the answer is yes, since for any odd integer $n$ the dihedral group $G = D_{2n}$ has $n_2(G) = n$.
But for every prime $p > 2$ there exist an integer $n \equiv 1 \pmod{p}$ such that there is no finite group $G$ with $n_p(G) = n$. This is a result of Marshall Hall:

Marshall Hall, Jr., On the number of Sylow subgroups in a finite group, J. Algebra 7 (1967), 363-371. DOI

For example:

*

*There is no finite group $G$ with $n_3(G) = 22$.

*There is no finite group $G$ with $n_5(G) = 21$.

*For every prime $p > 5$, there is no finite group $G$ with $n_p(G) = 1+3p$.

Hall also describes integers $n \equiv 1 \pmod{p}$ such that there exists a finite group $G$ with $n_p(G) = n$. By Theorem 2.2 from his paper:

Let $G$ be a finite group. Then $$n_p(G) = n_p(X_1) \cdots n_p(X_t) q_1 \cdots q_s$$ where $X_i$ is a finite simple group for all $1 \leq i \leq t$, and $q_i$ is a prime power $\equiv 1 \pmod{p}$ for all $1 \leq i \leq s$.

Note that conversely for $n = n_p(X_1) \cdots n_p(X_t) q_1 \cdots q_s$, for the group $$G = X_1 \times \cdots \times X_t \times \operatorname{AGL}(1,q_1) \times \cdots \times \operatorname{AGL}(1,q_s)$$ we have $n_p(G) = n$.
So to understand integers $n$ of the form $n = n_p(G)$, we are reduced to the case where $G$ is simple. With the classification of finite simple groups, in principle you could analyze the values of $n_p(G)$ further, but I am not sure if there is much more to be said in general.

EDIT: Some related references:

*

*Marcel Herzog, Counting group elements of order $p$ modulo $p^2$. Proc. Amer. Math. Soc. 66 (1977), no. 2, 247–250. DOI


*Benjamin Sambale, Pseudo Frobenius numbers. Expo. Math. 37 (2019), no. 2, 200-206. DOI


*Benjamin Sambale, Pseudo Sylow numbers. Amer. Math. Monthly 126 (2019), no. 1, 60-65. DOI


*Masafumi Murai, On the number of p-subgroups of a finite group. J. Math. Kyoto Univ. 42 (2002), no. 1, 161–174. link
There is also a related question by Jack Schmidt.
