= Solution
Write $q_n(X)=1+X+\cdots+X^{n-1}$, a monic <primitive polynomial>. If $n=ab$ with $a,b>1$, grouping terms gives a factorization in the <polynomial ring> $\mathbb Z[X]$:
$$
q_n(X)=(1+X+\cdots+X^{a-1})(1+X^a+\cdots+X^{(b-1)a}).
$$
Both factors have positive degree, so $q_n$ is not an <irreducible polynomial>.
Conversely, if $n=p$ is a <prime number>, change variables by $X=Y+1$. The <binomial theorem> gives
$$
q_p(Y+1)=\frac{(Y+1)^p-1}{Y}=p+\binom p2Y+\cdots+\binom p{p-1}Y^{p-2}+Y^{p-1}.
$$
Every coefficient except the leading one is divisible by $p$, because $p\mid\binom pk$ for $1\leq k<p$, whereas the constant coefficient $p$ is not divisible by $p^2$. The <Eisenstein criterion> makes this <polynomial> irreducible over $\mathbb Q$. The substitution $X\mapsto Y+1$ is an invertible <ring homomorphism>, so $q_p$ is also irreducible over $\mathbb Q$; the <Gauss lemma for polynomials> transfers this to $\mathbb Z[X]$. Hence
$$
\boxed{q_n\text{ is irreducible over }\mathbb Z\iff n\text{ is prime}.}
$$
Back to article page