4. Given the inequality about $x$
$$
(2 x-1)^{2}<a x^{2}
$$

has exactly $n$ positive integer solutions. Then the range of the real number $a$ is $\qquad$ .
$$
\begin{array}{l}
\text { 4. }\left(2-\frac{1}{n}\right)^{2}<a \leqslant\left(2-\frac{1}{n+1}\right)^{2} \text {. } \\
\text { Let } f(x)=|2 x-1|, g(x)=\sqrt{a}|x| \text {. }
\end{array}
$$

If the solution set of $f(x)<g(x)$ contains exactly $n$ positive integers, then they must be $1,2, \cdots, n$. Therefore,
$$
\begin{array}{l}
\left\{\begin{array}{l}
f(n)<g(n), \\
f(n+1) \geqslant g(n+1)
\end{array}\right. \\
\Rightarrow\left(2-\frac{1}{n}\right)^{2}<a \leqslant\left(2-\frac{1}{n+1}\right)^{2} .
\end{array}
$$