For which $n$ is $\sum_{i=0}^n x^i\in\mathbb{Q}[x]$ irreducible? I know that when $n+1=p$ is prime, $f=\sum_{i=0}^{p-1} x^i$ is the minimal polynomial of $\zeta_p$, a primitive $p$-th root of unity, hence is irreducible. This can be shown by applying Eisenstein to $f(x+1)$. However, I am lead to believe that when $n+1$ is $not$ prime, $f=\sum_{i=0}^n x^i$ will $not$ be irreducible. I have checked many examples, such as 
$$
x^5+x^4+x^3+x^2+x+1=(x+1)(x^2+x+1)(x^2-x+1).
$$
I also tried looking for a pattern in the factorizations, and it seems like $x^2+x+1$ and $x+1$ are showing up a lot. What is the best route to take here?
 A: Your polynomial is $\dfrac{x^{n+1}-1}{x-1}$. By definition of the cyclotomic polynomials, we have $x^{n+1}-1=\prod_{d\mid n+1}\phi_d(x)$.
Your polynomial will be irreducible if and only if it has exactly one factor (the cyclotomic polynomials are known to be irreducible), which will be the case if and only if $n+1$ is prime.
Therefore, $x^n+\cdots+x+1$ is irreducible if and only if $n+1$ is prime.
A: Note If $n+1= km$ then 
$$\sum_{i=0}^n x^i = \left( \sum_{i=0}^{k-1} x^i \right)\left( \sum_{j=0}^{m-1} x^{kj} \right)$$
A: If $n+1$ isn't prime, say $n+1=ab$, then
$$
\sum_{i=0}^{n}x^i = \frac{x^{n+1}-1}{x-1} = (\sum_{k=0}^{a-1}x^{k}) \cdot (\sum_{k=0}^{b-1}x^{ak})
$$For example, if $n=20$, we have
$$
\frac{x^{21}-1}{x-1} = \frac{x^3-1}{x-1}\cdot (1+x^3+x^6+x^9+x^{12}+x^{15}+x^{18})= \frac{x^7-1}{x-1}\cdot (1+x^7+x^{14})
$$Thus I think you can reduce the general case to products of prime-minus-one exponents. I'd look at cyclotomic polynomials for more information.
A: The polynomial $f=\sum_{i=0}^n x^i$ can also be written as
$$
f=\sum_{i=0}^n x^i = \frac{x^{n+1}-1}{x-1}.
$$
The numerator and the denominator of the fraction on the right hand side always cancel out, so the given polynomial is actually in $\mathbb{Z}[x]$. Now the question becomes: "For which $n$ the polynomial $x^{n+1}-1$ has more than two factors. All of this is answered in the theory of cyclotomic polynomials.
In particular for every divisor $d\mid n+1$ there is an irreducible polynomial $\Phi_d(x)\mid x^{n+1} - 1$, and 
$$
x^{n+1} - 1 = \prod_{d\mid n+1}\Phi_d(x).
$$
