2.47 Among the positive integers less than 10000, how many integers \( x \) are there such that \( 2^x - x^2 \) is divisible by 7?
(6th Moscow Mathematical Olympiad, 1940)
［Solution］First, we prove
$$
2^{21+r}-(21+r)^{2} \equiv 2^{r}-r^{2} \quad(\bmod 7) .
$$

where $r \in\{1,2,3, \cdots, 21\}$
In fact, by

then
$$
\begin{aligned}
2^{21}=\left(2^{3}\right)^{7}=8^{7} \equiv 1 & (\bmod 7), \\
2^{21+r} \equiv 2^{r} & (\bmod 7) .
\end{aligned}
$$

Also, $(21+r)^{2}=21^{2}+42 r+r^{2} \equiv r^{2}(\bmod 7)$,
thus (1) holds.
From (1), we know that $2^{x}-x^{2}$ has a periodic change with a period of 21 when divided by 7. Let $x=1,2, \cdots, 21$ to find that there are 6 numbers in $2^{x}-x^{2}$ that are divisible by 7.
That is, when $x=2,4,5,6,10,15$, $2^{x}-x^{2}$ is divisible by 7.
Since
$$
10000=476 \cdot 21+4,
$$

there are from 1 to 10000
$$
476 \cdot 6+1=2857
$$

numbers $x$ such that $2^{x}-x^{2}$ is divisible by 7.