Show that for all non-negatives integers $n$, it is true that $$\frac{1}{1+x^{1}}+\frac{2}{1+x^{2}}+\frac{4}{1+x^{4}}+\frac{8}{1+x^{8}}+\cdots+\frac{2^{n}}{1+x^{2^{n}}}=\frac{1}{x-1}+\frac{2^{n+1}}{1+x^{2^{n+1}}}$$ For $x \ne 1$, $x \ne -1$ I tried to solved it by appliying geometric series but I got the following after doing the $2f\left(x\right)-f\left(x\right)$ step, where $f\left(x\right)=\frac{1}{1+x^{1}}+\frac{2}{1+x^{2}}+\frac{4}{1+x^{4}}+\frac{8}{1+x^{8}}+\cdots+\frac{2^{n}}{1+x^{2^{n}}}$
$$f\left(x\right)=\frac{1}{x-1}+\frac{2^{n+1}}{1+x^{2^{n}}}$$ Not sure if Fermat's theorem is needed in order to solve it
Subtract $1/(x-1)$ from LHS and note that,
$$\frac 1{x+1}-\frac 1{x-1}=-\frac 2{x^2-1} \\ \frac 2{x^2+1}-\frac 2{x^2-1}=-\frac 4{x^4-1}\\ \frac 4{x^4+1}-\frac 4{x^4-1}=-\frac 8{x^8-1}$$
and so on. Do you see the telescoping pattern?
To finish, note that,
$$\frac {2^n}{x^{2^n}+1}-\frac {2^n}{x^{2^n}-1}=-\frac{2^{n+1}}{x^{2^{n+1}}-1}=\frac{2^{n+1}}{1-x^{2^{n+1}}}$$