First of all, the Putnam exam problem is about 2-groups and I highly doubt that the generalization proposed above is in any way tractable. That having been said, for $S_n$, every permutation has a cycle type labeled by a partition $\lambda=(\lambda_1\geq\lambda_2\geq\cdots\geq\lambda_n\geq0)$ of $n$. So
$$P(S_n)=\prod_{\lambda}\mathrm{lcm}(\lambda_1,\ldots,\lambda_n)|K_\lambda|$$
where, $K_\lambda$ is the conjugacy class labelled by $\lambda$. Its order is $\frac{n!}{z_\lambda}$ where, for $\lambda=(1^{m_1},2^{m_2},\ldots)$, $z_\lambda=\prod_{i\geq 1} i^{m_i}(m_i!)$.