Use mathematical induction to prove that for all integers $n \ge 2$, $2^{3n}-1$ is not prime I had a homework due yesterday with this problem.
The TA did the problem last week in discussion but I didn't understand it.
She pulled out a $7k$ almost immediately, and I have no idea from where.
It was like, it wasn't prime if $2^{3n}-1$ was 7 times some constant. I understand that that would make $2^{3n}-1$ not prime, but I don't understand how she just used "7".
Where did she get that from? I was thinking, maybe it was like $2^3 \cdot 2^n-1$... which is $8 \cdot 2^n-1$... but you can't just do $8-1$. How?

I’m sure that she used the following factorization
$$\begin{align*}
2^{3n}-1&=(2^3)^n-1\\
&=8^n-1^n\\
&=(8-1)(8^{n-1}\cdot 1^0+8^{n-2}\cdot 1^1+\dots+8^2\cdot 1^{n-3}+8^1\cdot 1^{n-2}+8^0\cdot 1^{n-1}\\
&=7(8^{n-1}+8^{n-2}+\dots+8^2+8+1)\\
&=7\sum_{k=0}^{n-1}8^k\;,
\end{align*}$$
which as Dylan Moreland pointed out is a special case of $$\begin{align*}a^n-b^n&=(a-b)(a^{n-1}b^0+a^{n-1}b^1+\dots+a^1b^{n-2}+a^0b^{n-1})\\
&=(a-b)\sum_{k=0}^{n-1}a^kb^{n-1-k}\end{align*}\;.$$
This is really just the formula for the sum of a finite geometric series in disguise:
$$\begin{align*}
\sum_{k=0}^{n-1}a^kb^{n-1-k}&=b^{n-1}\sum_{k=0}^{n-1}\left(\frac{a}b\right)^k\\
&=b^{n-1}\frac{\left(\frac{a}b\right)^n-1}{\frac{a}b-1}\\
&=\frac{\frac{a^n}b-b^{n-1}}{\frac{a-b}b}\\
&=\frac{a^n-b^n}{a-b}\;,
\end{align*}$$
and multiplying through by $a-b$ yields the factorization formula.
