There are $n!$ waysYou want to count the number of writing $n$ elements in a sequence.
Givenset partitions of a sequenceset of elements$n$ elments, split it into sets$n/k$ parts each of size $k$ each. (It is assumed that $k$ divides $n$.)
Method 1.
We can generate such a partition by writing down the $n$ elements in a sequence, as follows:and then declaring that the first $k$ elements are the first part, the next $k$ elements are the second part, and so on. ForThere are $n!$ ways of writing $n$ elements in a sequence, but each partition is generated multiple times: for each of the $n/k$ parts, there are $k!$ orderings of the $k$ elements in that part that would lead to the same partspartition, as you don't care about the order within each part. Further, as you also don't care about the order of thesethere are $n/k$$(n/k)!$ orderings of the parts themselves, further divide by $(n/k)!$for the same partition.
The number of partitions is therefore: $$\frac{n!}{(k!)^{n/k} (n/k)!}$$
Method 2.
You can choose the elements of the first part in $\binom{n}{k}$ ways, then choose the elements of splitting a setthe second part as $k$ out of sizethe remaining $n$ into$n-k$ in $n/k$ parts each$\binom{n-k}{k}$ ways, and so on. But as different orderings of sizethe $k$$(n/k)$ parts don't change the partition, the number of partitions is therefore:
$$\frac{\binom{n\vphantom{k}}{k}\binom{n-k}{k}\cdots\binom{k}{k}}{(n/k)!} = \frac{n!}{(k!)^{n/k}(n/k)!}$$ $$\frac{n!}{(k!)^{n/k} (n/k)!}$$as before.
You can checkverify that this accords with all your cases. For instance, for $n=15$ and $k=5$, you get $\frac{15!}{5!^3 3!} = 126126$. These numbers are tabulated in OEIS A060540, and no simpler formula is listed.