TITLE: For how many positive integers $n$ is $4^n − 1$ a prime number?
QUESTION [5 upvotes]: This was the initial question and one of the methods to work it out include this:
The second method uses the fact when $n$ is a positive integer $x − 1$ is a factor of $x^n − 1$,
since, for $n ≥ 2$,
$$x^n − 1 = (x − 1)(x^{n−1} + x^{n−2} + \ldots + x + 1).$$
Hence, putting $x = 4$, we deduce that, for each positive integer $n, 3$ is a factor of $4^n − 1$. Therefore $4^n −1$ is not prime except when $n = 1$ and $4^n −1 = 3$. So there is just one positive integer $n$ for which $4^n − 1$ is a prime number.
However, I don't understand the initial method and how they deduced that $x-1$ is a factor of $x^n - 1$

REPLY [2 votes]: Knowing that $x-1$ is a factor of $x^n-1$ is somewhat a matter of experience. It comes up often in various problems or theorems, and it's something you'll get used to. A couple of ways to look at it: 

Recall that $x^2-1 = (x-1)(x+1)$. The identity in your question is a generalization of this.
Think of the geometric formula $1+x+\ldots+x^n = \frac{1-x^{n+1}}{1-x}$. Multiplying both sides by $1-x$ gives you the identity.