Show that if $p$ is prime and $2^p-1$ is composite, then $2^p-1$ is a pseudoprime to the base $2$.
I need to show that $2^{2^p-1}\equiv2\pmod{2^p-1}$. The way I "achieved" this was by doing the following: $2^{2^p-1}\equiv2\pmod{2^p-1},$ $2^{2^p}\equiv4\pmod{2^p-1},$ $4^{2^{p-1}}\equiv4\pmod{2^p-1},$ $2^p-1\equiv1\pmod{2^p-1}.$ Since the congruence does not hold, it must be false that $2^p-1$ is a pseudoprime to the base $2$. Is this approach correct?