The question was:
*Find all $n \in \mathbb{N}$ for which $2^{2^n}-2^{n^2}$ is divisible by 7.
I think I found the correct solution but I was unable to find the correct answer and since the numbers are so big, I cannot use anything to see if my answer is correct. I think some of my steps were invalid, so I'd like to see your feedback.
These were my steps: $$7\vert2^{2^n}-2^{n^2} \implies 2^{2^n} \equiv 2^{n^2} \pmod{7} $$
We can divide by $2^{n^2}$ to get $$2^{2^n-n^2} \equiv 1 \pmod{7} $$
Let $X=2^n-n^2$. Then $$2^{X} \equiv 1 \pmod{7} $$ And since we know that $$2^3 \equiv 1 \pmod{7} \implies 2^{3n} \equiv 1 \pmod{7}$$ It means that $X$ must be divisible by $ 3$. Therefore $$3\vert X \implies 3\vert2^n-n^2 \implies 2^n \equiv n^2 \pmod{3} $$
Now, there are three cases. $$2^n \equiv 0 \pmod{3}$$ $$2^n \equiv 1 \pmod{3}$$ $$2^n \equiv 2 \pmod{3}$$
This one is impossible, because any number $2^n$ does not have $3$ in its multiplicative form. $$2^n \equiv 0 \pmod{3}$$
The second one is true for even $n$, where the last line confirms that the exponent ($n$) must be divisible by 2. $$2^n \equiv 1 \pmod{3}$$ $$2^2 \equiv 1 \pmod{3}$$ $$2^{2m} \equiv 1^m \pmod{3}$$
The third line is true for odd $n$, where the last line confirms that $n-1$ must be divisible by two which happens only when $n$ is odd. $$2^n \equiv 2 \pmod{3}$$ $$2^{n-1} \equiv 1 \pmod{3}$$ $$2^{2} \equiv 1 \pmod{3}$$ $$2^{2m} \equiv 1^m \pmod{3}$$
Now, we take the cases of $n^2$. For any number $n$, it can only be congruent to $0$, $1$, or $2$. $$n \equiv 0 \pmod{3}$$ $$n \equiv 1 \pmod{3}$$ $$n \equiv 2 \pmod{3}$$ Therefore, for $n^2$, we square both sides. $$n^2 \equiv 0^2 \pmod{3} \implies n^2 \equiv 0 \pmod{3}$$ $$n^2 \equiv 1^2 \pmod{3} \implies n^2 \equiv 1 \pmod{3}$$ $$n^2 \equiv 2^2 \pmod{3} \implies n^2 \equiv 1 \pmod{3}$$ And now we can see that there are only two possible remainders: $0,1$.
To summarise, $2^n$ only has $1$ and $2$ as its possible remainders while $n^2$ only has $0$ and $1$ as its remainders. Their only common possible remainder is $1$.
$2^n$ has the remainder $1$ for all even $n \in \mathbb{N}$.
$n^2$ has the following period of remainders: $$0^2 \equiv 0 \pmod{3}$$ $$1^2 \equiv 1 \pmod{3}$$ $$2^2 \equiv 1 \pmod{3}$$ $$3^2 \equiv 0 \pmod{3}$$ $$4^2 \equiv 1 \pmod{3}$$ $$5^2 \equiv 1 \pmod{3}$$ $$6^2 \equiv 0 \pmod{3}$$ $$7^2 \equiv 1 \pmod{3}$$ $$8^2 \equiv 1 \pmod{3}$$ $$9^2 \equiv 0 \pmod{3}$$ $$10^2 \equiv 1 \pmod{3}$$ $$11^2 \equiv 1 \pmod{3}$$
As can be seen from the sequence, the only even $n$ that are congruent with $1$ are numbers $2$ and $4$, and all numbers that are in the form of $2+n\cdot 6$ or $4+n\cdot 6$. I think that's the correct answer, but I am not sure.