Prove $n$ is prime. (Fermat's little theorem probably) 
Let $x$ and $n$ be positive integers such that $1+x+x^2\dots x^{n-1}$ is prime. Prove $n$ is prime

My attempt:
Say the above summation equal to $p$ $$1+x+x^2\dots x^{n-1}\equiv 0\text{(mod p)}\\
{x^n-1\over x-1}\equiv0\\
\implies x^n\equiv1\text{ (as $p$ can't divide $x-1$)}$$
How to proceed?

If $n$ is not prime, you can write it as $ab$; with $a,b\in\mathbb N\setminus\{1\}$. Then$$x^n-1=x^{ab}-1=(x^a)^b-1^b=(x^a-1)\left(x^{a(b-1)}+x^{a(b-2)}+\cdots+1\right)$$and therefore$$1+x+\cdots+x^{n-1}=\frac{x^n-1}{x-1}=(x^{a-1}+a^{a-2}+\cdots+1)\left(x^{a(b-1)}+x^{a(b-2)}+\cdots+1\right).$$
