If we take the square of a number not divisible by 5 and add 1 to it, or subtract 4 from it, we get a number divisible by 5.
Numbers not divisible by 5 are of the form $5a \pm 1$ or $5a \pm 2$.

$$
(5a \pm 1)^{2}=25a^{2} \pm 10a+1
$$

and

$$
(5a \pm 2)^{2}=25a^{2} \pm 20a+4
$$

thus

$$
(5a \pm 1)^{2}-1=5a(5a \pm 2)
$$

and

$$
(5a \pm 2)^{2}+1=5\left(5a^{2} \pm 4a+1\right)
$$

Number of solutions: 37.