$2 \cdot 40$ Find all natural numbers $n$ such that $n \cdot 2^{n}+1$ is divisible by 3.
(45th Moscow Mathematical Olympiad, 1982)
[Solution] If $3 \mid n \cdot 2^{n}+1$, then
$$
n \cdot 2^{n} \equiv 2 \quad(\bmod 3) \text {. }
$$

When $n=6 k+1 \quad(k=0,1,2, \cdots)$,
$$
\begin{aligned}
n \cdot 2^{n} & =(6 k+1) \cdot 2^{6 k+1} \\
& =(12 k+2) \cdot 4^{3 k} \\
& =(12 k+2)(3+1)^{3 k} \\
& =2(\bmod 3) .
\end{aligned}
$$
- When $n=6 k+2 \quad(k=0,1,2, \cdots)$,
$$
\begin{aligned}
n \cdot 2^{n} & =(6 k+2) \cdot 2^{6 k+2} \\
& =(24 k+8) \cdot(3+1)^{3 k} \\
& \equiv 2(\bmod 3) .
\end{aligned}
$$

When $n=6 k+3 \quad(k=0,1,2, \cdots)$,
$$
\begin{aligned}
n \cdot 2^{n} & =(6 k+3) \cdot 2^{6 k+3} \\
& =0 \quad(\bmod 3)
\end{aligned}
$$

When $n=6 k+4 \quad(k=0,1,2, \cdots)$,
$$
\begin{aligned}
n \cdot 2^{n} & =(6 k+4) \cdot 2^{6 k+4} \\
& =(96 k+64) \cdot 2^{6 k} \\
& =(96 k+64)(3+1)^{3 k} \\
& =1 \quad(\bmod 3) .
\end{aligned}
$$

When $n=6 k+5 \quad(k=0,1,2, \cdots)$,
$$
\begin{aligned}
n \cdot 2^{n} & =(6 k+5) \cdot 2^{6 k+5} \\
& =(6 \cdot 32 k+160)(3+1)^{3 k} \\
& \equiv 1 \quad(\bmod 3) .
\end{aligned}
$$

When $n=6 k \quad(k=1,2, \cdots)$,
$$
\begin{aligned}
n \cdot 2^{n} & =6 k \cdot 2^{6 k} \\
& \equiv 0 \quad(\bmod 3) .
\end{aligned}
$$

From the above, $n \cdot 2^{n}$ is divisible by 3 if and only if $n=6 k+1,6 k+2$.