5. If $n \leqslant 2011$, then the number of positive integers $n$ such that $1+17 n$ is a perfect square is ( ) .
(A) 20
(B) 22
(C) 24
(D) 26
5. A.

Let $1+17 n=a^{2}$ (where $a$ is a positive integer). Then $n=\frac{a^{2}-1}{17}=\frac{(a+1)(a-1)}{17}$.
Since $n$ is a positive integer and 17 is a prime number, we have $a+1=17 b$ or $a-1=17 c$ (where $b, c$ are positive integers).
(1) When $a+1=17 b$, $n=\frac{a^{2}-1}{17}=17 b^{2}-2 b \leqslant 2011$.
Since $b$ is a positive integer, we have $1 \leqslant b \leqslant 10$.
In this case, there are 10 positive integers that make $1+17 n$ a perfect square.
(2) When $a-1=17 c$,
$$
n=\frac{a^{2}-1}{17}=17 c^{2}+2 c \leqslant 2011 \text {. }
$$

Similarly, there are 10 positive integers that make $1+17 n$ a perfect square.
In summary, there are 20 positive integers $n$ that meet the conditions.