Show that if $n\geq3$ is odd, then $2^n-1\equiv7\mod24$.
I tried solving this backwardly. We want to prove that $2^3(2^{n-3}-1)=2^n-2^3\equiv0\mod24$. Since $\frac{24}{2^3}=3$, this leaves us to prove that $3\mid2^{n-3}-1$. From here on I got stuck, although I feel like I am ignoring something very simple.
Once the result is proved, I need to find all $n\in\mathbb{Z}_{>0}$ for which $2^n-1$ divides $3^n-1$.
This problem is given in a chapter on the Legendre symbol, introducing the law of quadratic reciprocity.
Remember $n$ is odd, so writing $n=2k+1$ gives $$2^{n-3}-1\equiv 2^{2k-2}-1\equiv (2^2)^{k-1}-1\equiv 1-1\equiv 0\pmod{3}$$