<s>[INST] 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?
 [/INST] If $x = 1$, it's obvious.
For $x>1$, let $n$ be composite, say $n = pq$ with $p, q>1$. In that case, we have
$$
(1+x+\cdots+x^{n-1})(x-1) = x^n-1 = x^{pq}-1\\
= (x^p)^q-1\\
= (1+x+x^p+x^{2p}+\cdots + x^{(q-1)p})(x^p-1)
$$
Thus $x^p-1$ divides $x^n-1$, but is not equal to it. In other words, $\frac{x^n-1}{x^p-1}$ is an integer greater than $1$. We get
$$
\frac{x^n-1}{x^p-1} =\frac{(1+x+\cdots+x^{n-1})(x-1)}{(1+x+\cdots +x^{p-1})(x-1)}\\
= \frac{1+x+\cdots+x^{n-1}}{1+x+\cdots +x^{p-1}}
$$
That final fraction is an integer greater than $1$, and the denominator is an integer greater than $1$, which means that the numerator must be composite.
</s>