This question is taken from "An Introduction to Algebraic Number Theory through Olympiad Problems" by Elias Caeiro, p.151
Let $n \geq 2$ be a positive integer. What is the gcd of the numbers $1^n-1,2^n-1, \ldots, n^n-1$ ?
The solution given by the books is as follows:
Solution:
Let $d$ be this gcd. Suppose $p$ is a prime factor of $d$. If $p \leq n$, then $p \mid p^n-1$ which is impossible. Thus $p>n$. Consider the polynomial
$$ X^n-1-(X-1) \cdot \cdots \cdot(X-n) $$
in $\mathbb{F}_p[X]$. It has degree at most $n-1$ and $n$ roots (in $\mathbb{F}_p$ ) by assumption, thus it is the zero polynomial . Hence we have
$$ X^n-1 \equiv(X-1) \cdot \cdots \cdot(X-n) \quad(\bmod p) $$
Expand the RHS and consider the coefficient of $X^{n-1}$; it is $-(1+\ldots+n)=-\frac{n(n+1)}{2}$. On the other hand, since $n \geq 2$, the coefficient of $X^{n-1}$ of the LHS is 0 . Thus
$$ p \lvert\, \frac{n(n+1)}{2}. $$
Since $p>n$, this means $p=n+1$. Thus, if $n+1$ is composite we are already done: the gcd is 1 .
If $n+1=p$ is prime, the gcd $d$ is a power of $p$ and we must find out what it is. Clearly, $p$ is odd.
By Fermat's little theorem, $p \vert k^n-1$ for $k=1, \ldots, n$ so $p \vert d$. It remains to prove that $p^2 \nmid d$.
For this, suppose for the sake of contradiction that $p^2 \vert (p-1)^{p-1}-1$. Then,
$$p \lvert\, \frac{(p-1)^{p-1}-1}{(p-1)^2-1}=\sum_{k=0}^{\frac{p-1}{2}-1}(p-1)^{2 k} \equiv \frac{p-1}{2} (\mod p).$$
which is a contradiction so we are done in this case too: $d=n+1$ if it is prime and 1 otherwise.
My question is: why does the polynomial have $n$ roots in $\mathbb{F}_p$?
I know that a polynomial of degree $n-1$ have $n-1$ roots in $\mathbb{C}$, but I can't make sense of it in $\mathbb{F}_p$
(I am a beginner in algebraic number theory, so forgive me if I don't show much depth of thought on this question)