8. (10 points) Among all positive integers $n$ less than 2012, the number of $n$ for which $2^{n}-n^{2}$ is divisible by 7 is $\qquad$.


【Analysis】$2^{n}-n^{2}$ when divided by 7, the smallest period of the remainder as $n$ changes is 3, which you can calculate and try to know. Starting from $n=1$, the remainder of $2^{n}-n^{2}$ when divided by 7 is $2,4,1,2,4,1, \cdots$ The smallest period of the remainder of $2^{n}-n^{2}$ when divided by 7 as $n$ changes is clearly 7. Starting from $n=1$, the remainder of $2^{n}-n^{2}$ when divided by 7 is $1,4,2,2,4,1,0$, .

In general, because 3 and 7 are coprime, the remainder of $2^{n}-n^{2}$ when divided by 7 has a period of $3 \times 7=21$. In one cycle, when 3 divides $n$ and leaves a remainder of 1, 7 can divide $n$ and leave a remainder of 3 and 4, corresponding to the numbers 10 and $4$; when 3 divides $n$ and leaves a remainder of 2 (at this point, $2^{n}-n^{2}$ when divided by 7 leaves a remainder of 4), 7 can divide $n$ and leave a remainder of 2 and 5, corresponding to the numbers 2 and $5$; when 3 divides $n$ and leaves a remainder of 0 (at this point, $2^{n}-n^{2}$ when divided by 7 leaves a remainder of 1), 7 can divide $n$ and leave a remainder of 1 and 6, corresponding to the numbers 15 and 6.

From the above discussion, all positive integers $n$ that make $2^{n}-n^{2}$ divisible by 7 are $2,4,5,6,10,15$ and their multiples plus an integer multiple of 21.

With this result, it is not difficult to find that among all positive integers less than 2012, because $2012=21 \times 95+17$, there are
$$
95 \times 6+6=576 \text{ such } n,
$$

Therefore, the answer is: 576.

【Solution】Solution: Because the remainder of $2^{n}-n^{2}$ when divided by 7 changes with the smallest period of 3, starting from $n=1$, the remainder of $2^{n}-n^{2}$ when divided by 7 is $2,4,1,2,4,1$ because 3 and 7 are coprime, the remainder of $2^{n}-n^{2}$ when divided by 7 has a period of $3 \times 7=21$.
7 divides $n$ and can leave a remainder of 2 and 5, corresponding to the numbers 2 and 5;
3 divides $n$ and leaves a remainder of 0 (at this point, $2^{n}-n^{2}$ when divided by 7 leaves a remainder of 1),
7 divides $n$ and can leave a remainder of 1 and 6, corresponding to the numbers 15 and 6
In summary:
All positive integers $n$ that make $2^{n}-n^{2}$ divisible by 7 are $2,4,5,6,10,15$ and their multiples plus an integer multiple of 21.

With this result, it is not difficult to find that among all positive integers less than 2012, because $2012=21 \times 95+17$, there are
$$
95 \times 6+6=576 \text{ such } n,
$$

Therefore, the answer is: 576.