20. (USSR 1) Find all natural numbers $n$, such that every natural number represented in decimal notation with $n$ - 1 digits of 1 and one digit of 7 is a prime number.
Solve: A natural number $N$ composed of $n-1$ digits 1 and one digit 7 can be expressed as
$$
N=A_{\mathrm{a}}+6 \times 10^{\mathrm{k}},
$$

where $A_{0}$ is a natural number consisting of $n$ ones, and $0 \leqslant k \leqslant n$. It is a prime number. For any positive integer 1, we have $10=1$ (mod7). Therefore,
$$
\begin{array}{l}
A_{6 \mathrm{t}+\mathrm{s}}=A_{51}+A_{s} 10^{\circ} \mathrm{l} \\
\equiv A_{n t}+A_{0}(n \operatorname{mod} 7),
\end{array}
$$

Thus, we have
$$
\begin{array}{l}
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_{0}-0(\bmod 7)
\end{array}
$$
$(\bmod 7)$.
Notice that
$$
\begin{array}{l}
10^{\circ} \equiv 1(\bmod 7), 10^{1} \equiv 3(\bmod 7), \\
10^{2} \equiv 2(\bmod 7), 10^{3} \equiv 6(\bmod 7), \\
10^{4} \equiv 4(\bmod 7), 10^{5} \equiv 5(\bmod 7),
\end{array}
$$

Therefore, for the above $r$, there must be a $k$, $0 \leqslant k \leqslant 5$, such that $6 \times 10^{k} \equiv 7-r(\bmod 7)$. Thus, when $n > 6$, we have
$$
N=A_{\mathrm{a}}+6 \times 10^{\mathrm{k}} \equiv r+(7-r)
$$
$\equiv 0(\bmod 7)$, hence $N$ is not a prime number.
However, we still need to consider the cases where $n=1,2,4,5$. For $n=1$, 7 is a prime number; for $n=2$, the numbers $17$ and $71$ are both prime numbers; for $n=5$, we have
$$
A_{5}+6 \times 10^{2} \equiv 0 \text { (mod7), }
$$

i.e., $7 \mid 11711$; for $n=4$, we have $1711=29 \times 59$.
In summary, the natural numbers that satisfy the requirements of this problem are two, namely $n=1, 2$.