Find n where $(2n+1)2^{4n+5} = 3 \pmod{7}$ For $n$ normal number, the book solved it like this:
If $n$ can be divided by $3$ (which is $n = 3k$) then $n = 21L + 9$.
If $n$ can't be divided by 3(Which is either $n = 3k +1$ or $n = 3k + 2$) then $n = 21L + 1$ or $n = 21L + 2$ .
But I didn't solve it like this.
My logic is that since 3 is a prime number then $(2n+1)2^{4n+5} = 3 \pmod{7}$ means either $2^{4n+5} = 3\pmod{7}$ and $ 2n + 1 = 1\pmod{7} $ or the other way around.
But since there is no $n$ value that can make $2^{4n+5} = 3\pmod{7}$ then it means:
$ 2n + 1 = 3 \pmod{7}$ and by calculating we find in the end $n = 7k' + 1$
And $ 2^{4n+5} = 1\pmod{7}$ and by calculating we find that $n = 3k''$
So it means that $n = 7k' + 1$ AND $n = 3k''$
So, I know that my solution is faulty but can anyone explains to me the right solution or point out where I went wrong?

This is somewhere between a comment and an answer.
The simplest way to solve this is that the value of $(2n+1)2^{4n+5}$ is precisely a function of $n \mod 42 = 6 \times 7$. More precisely, $2n+1 \mod 7$ is precisely a function of $n \mod 7$ while $2^{4n+5} \mod 7$ is precisely a function of $n \mod 6$. For each $i \in \{0,1,2,3,4,5\}$, you can check directly what $n \mod 7$ must be--in particular, what $(2n+1) \mod 7$ must be, given $n \mod 6$--in particular, what is $2^{4n+5} \mod 7$, which is a function of $n \mod 6$.
For example, for the case where $n = 0 \mod 6$ , we see that $2^{4n+5}= 1 \times 2^5 = 32 = 4 \mod 7$. So $2^{4n+5}$ is $4 \mod 7$ for this case where $n = 0 \mod 6$. So for the case where $n = 0 \mod 6$, the integer $n$ must satisfy the equation $(2n+1) \times 4 = 3 \mod 7$, which gives $n = 6 \mod 7$. So for the case where $n = 0 \mod 6$, the integer $n$ must also be $6 \mod 7$ which gives $n = 6 \mod 42$. What about the case where $n = 1 \mod 6$. What about each of the cases where $n \mod 6 = i=2,3,4,5$.
This in fact would work if $2n+1, 4n+5$ were each replaced by any two polynomials in $n$. Can you see why this is.
