3.42 Find all natural numbers $n$, such that every natural number represented in decimal notation by $n-1$ digits 1 and one digit 7 is a prime number.
(31st International Mathematical Olympiad Preliminary Question, 1990)
[Solution] A natural number $N$ composed of $n-1$ ones and one 7 can be expressed as
$$
N=A_{n}+6 \cdot 10^{k},
$$

where $A_{n}$ is a natural number composed of $n$ ones, and $0 \leqslant k < n$. Therefore, $N$ is not a prime number.
Now consider the case where $3 \nmid n$.
By Fermat's Little Theorem, we have
$$
\begin{array}{c}
\left(10^{6}\right)^{t} \equiv 1 \quad(\bmod 7), \\
10^{6 t} \equiv 1 \quad(\bmod 7) .
\end{array}
$$

Thus,
$$
\begin{aligned}
A_{6 t+s} & \equiv A_{6 t}+A_{s} \cdot 10^{6 t} \\
& \equiv A_{6 t}+A_{s} \quad(\bmod 7)
\end{aligned}
$$

Notice that
$$
\begin{array}{l}
10^{\circ} \equiv 1 \quad(\bmod 7), \quad 10^{1} \equiv 3 \quad(\bmod 7), \\
10^{2} \equiv 2 \quad(\bmod 7), \quad 10^{3} \equiv 6 \quad(\bmod 7), \\
10^{4} \equiv 4 \quad(\bmod 7), \quad 10^{5} \equiv 5 \quad(\bmod 7) . \\
\end{array}
$$

Also,
$$
\begin{array}{llll}
A_{1} \equiv 1 & (\bmod 7), & A_{2} \equiv 4 & (\bmod 7) \\
A_{3} \equiv 6 & (\bmod 7), & A_{4} \equiv 5 & (\bmod 7), \\
A_{5} \equiv 2 & (\bmod 7), & A_{6} \equiv 0 & (\bmod 7) .
\end{array}
$$

Therefore, if and only if $6 \mid n$,
$$
A_{n} \equiv 0 \quad(\bmod 7) \text {. }
$$

Thus, when $6 \nmid n$,
$$
A_{n} \equiv r \not \equiv 0 \quad(\bmod 7) .
$$

Therefore, when $6 \nmid n$, there must exist a $k, 0 < k < n$ such that
$$
\begin{aligned}
N & =A_{n}+6 \cdot 10^{k} \\
& \equiv r+(7-r) \\
& \equiv 0 \quad(\bmod 7)
\end{aligned}
$$

In this case, $N$ is not a prime number.
Finally, consider the cases when $n=1,2,4,5$.
When $n=1$, $N=7$ is a prime number;
When $n=2$, $N=17,71$ are prime numbers;
When $n=4$, $1711=29 \cdot 59$ is not a prime number;
When $n=5$, $11711=11111+6 \cdot 10^{2} \equiv 0 \quad(\bmod 7)$, i.e., $11711=7 \cdot 1673$ is not a prime number.
Therefore, the only values of $n$ that satisfy the problem are $n=1,2$.