I was reading one of the Fermat theorem proof from the wikipedia
Specifically the theorem: " If $2^{k}+1$ is an odd prime, then $k$ is a power of 2."
In the proof it says:
Substituting $a=2^{r}$,$b=-1$,$b=-1$, $m = s$ and using that $s$ is odd
I originally thought that we could have used $a=2^s$ and $m=r$ and it seemed to me it should work too, but I was wondering if I am misunderstanding something as that statement there using that s is odd I am not sure if it means something more and would create a problem with a different substitution
If $k\in \Bbb Z^+$ and if $k$ is not a power of $2$ then $k\ge 3$ and $k$ has an odd divisor $p>1.$ So $k=k'p$ with $p$ odd and $p\ge 3$ and $k'\in \Bbb Z^+.$ Then, because $p$ is odd, we have $$2^k+1=2^{pk'}+1=(2^{k'})^p+1\equiv (-1)^p+1\equiv (-1)+1\equiv 0 \pmod {2^{k'}+1}$$ so $2^{k'}+1$ is a divisor of $2^k+1$ with $1<2^{k'}+1<2^{k'\cdot 3}+1\le 2^{k'p}+1=2^k+1$
so $2^k+1$ is not prime.
We can also see that $2^{k'}+1$ is a proper divisor of $2^k+1$ from the algebraic identity $x^p+1=(x+1)(x^{p-1}-x^{p-2}+-...+1)$ when $p$ is odd and $p\ge 3$. E.g
$x^3+1=(x+1)(x^2-x+1).$
$ x^5+1=(x+1)(x^4-x^3+x^2-x+1).$
$x^7+1=(x+1)(x^6-x^5+x^4-x^3+x^2-x+1)$, et cetera.
For example with $x=2^{k'}$ and if $p=5.$ Then $x>1$ so $$x^4-x^3+x^2-x+1=(x^4-x^3)+(x^2-x)+1>1.$$