x^n-1=\left(x-1\right)\left(x^{n-1}+x^{n-2}+\cdots +x^2+x+1\right)