For which values of n is $$2^{n}-1$$ divisible by 7? And why?
I've tried saying that $2^n\equiv 1 \pmod 7$ based on Little Fermat's Theorem $n$ should be a multiple of $6,$ but in fact the answer is that it should be a multiple of three and I don't know how to get there.
We can use modular arithmetic. First understand that $n$ is clearly an integer
$$2^n - 1 \equiv 0 \mod 7$$ $$2^n \equiv 1 \mod 7$$ $$2^{3 \cdot n/3} \equiv 1 \mod 7$$ $$8^{n/3} \equiv 1 \mod 7$$ The next step only holds if $n/3$ is an integer $$1^{n/3} \equiv 1 \mod 7$$
Therefore, if $ n \equiv 0 \mod 3$, then it is possible.