Factoring Binomials `x^n-a^n`

It is known, that

`color(red)(x^2-a^2=(x-a)(x+a))`,

`color(blue)(x^3-a^3=(x-a)(x^2+xa+a^2))`.

When we multiply the polynomials `x-a` by `x^3+x^2a+xa^2+a^3`, we will obtain `color(green)(x^4-a^4=(x-a)(x^3+x^2a+xa^2+a^3))`.

Generalization of previous formulas are formula of factoring binomials of `x^n-a^n`:

`x^n-a^n=(x-a)(x^(n-1)+x^(n-2)a+x^(n-3)a^2+...+xa^(n-2)+a^(n-1))`.

So, `x^7-1=(x-1)(x^6+x^5+x^4+x^3+x^2+x+1)`.