Find $\,n\bmod 42\,$ given $\,7\mid 3^n+4n+1$ I have been working on a problem relating to remainders: "The number $3^n+4n+1$ is divisible by $7$. Find the remainder of n when it is divided by $42$." I have been unable to find a strategic way to solve this problem and so far, I have only found the remainders, $4$, $8$, $13$, $21$, $23$, and $24$. Can anyone confirm whether this is correct?

Strategy:
$4n + 1 \equiv k \pmod 7$ will have a solution $n_k$ determined by $n \mod 7$.  And for $k = 0,... 7$ there will be $7$ solutions $n_0, ... n_6$.
By Fermats little Theorem, $3^6\equiv 1 \pmod 7$ for $3^n \equiv j\pmod 7$ will have a solution $m_j$ determined by  $n \pmod 6$.  If we assume $3$ is a primitive root (an assumption for now but one easily determined by simple calcultions) for $j= 1,2,3,...6$ there will be six solutions: $m_1,...,m_6$
So to have $3^n + 4n + 1\equiv k - k \equiv 0 \pmod 7$ is a matter of finding the six $n_k, m_{7-k}$ pairs and solving $n \equiv n_k \pmod 7$ and $n_{7-k} \pmod 6$.
By the Chinese Remainder Theorem, for each $n_k, m_{7-k}$ pair there will precisely one solution $\mod 6*7$.
======= Full Answer below=====
The strategic way I'd consider would figure $3^n$ has a cyclic $\mod 7$ and figure what that is.  Presumable $3$ is a primitive root and the cycle is  and $3^n \equiv 1,3,2,6,4,5 \pmod 7$ if $n \equiv 0,1,2,3,4,5,6 \pmod 6$
Meanwhile $4n + 1 \equiv 1,5,2,6,3,0,4 \pmod 7$ when $n \equiv 0,1,2,3,4,5,6,7$
We need $3^n + 4n + 1 \equiv 0 \pmod 7$ so 
if $n \equiv 0 \pmod 7$ then $4n+1\equiv 1$ and we $3^n\equiv -1$ so we would need $n \equiv 0 \pmod 7$ and $n\equiv 3\pmod 6$.
Similarly if $n\equiv 1,2,3,4,5,6 \pmod 7$ we have $4n+1 \equiv 5,2,6,3,0,4 \pmod 7$ and we need $3^n \equiv 2,5,1,4,0,3 \pmod 7$ so we need $n\equiv 2,5,0, 4, impossible,1 \pmod 6$.
Now by CRT th each of these pairs of options has a unique solution:
1) If $n\equiv 0 \pmod 7;n\equiv 3 \pmod 6$ then $n \equiv 21 \pmod {42}$.
2) If $n\equiv 1 \pmod 7;n\equiv 2 \pmod 6$ then $n \equiv 8 \pmod {42}$.
3)If $n\equiv 2 \pmod 7;n\equiv 5 \pmod 6$ then $n \equiv 23 \pmod {42}$.
4)If $n\equiv 3 \pmod 7;n\equiv 0 \pmod 6$ then $n \equiv 24 \pmod {42}$.
5) If $n \equiv 4 \pmod 7; n\equiv 4\pmod6$ then $n \equiv 4 \pmod {42}$
6) If $n \equiv 6 \pmod 7; n\equiv 1\pmod 6$ then $n \equiv 13 \pmod {42}$.
