Problem 879: (2005 AMC 10b, 22)
For how many positive integers $n$ less than or equal to $24$ is $n!$ evenly divisible by $1 + 2 + \ldots + n$?
$\textbf{(A)} 8 \qquad \textbf{(B)} 12 \qquad \textbf{(C)} 16 \qquad \textbf{(D)} 17 \qquad \textbf{(E)} 21$
- $\frac{n(n+1)}2\mid n!$ exactly when $n+1\mid2(n-1)!$. If $n+1$ is an odd prime, it does not divide $2(n-1)!$. Otherwise ($n+1$ composite, or $n+1=2$) it does: for composite $n+1=ab$ with $1<a\le b<n+1$, both factors appear in $(n-1)!$ (or $n+1=4$, $2\cdot2!=4$; or $n+1=p^2$, using $p$ and $2p$).
- $n\le24$ with $n+1$ an odd prime: $n+1\in\{3,5,7,11,13,17,19,23\}$: $8$ values.
- So $24-8=16$. The answer is (C).
For how many positive integers $n\le30$ is $n!$ evenly divisible by $1+2+\cdots+n$?