  This paper concerns a long-standing problem raised by Beurling and Wintner on
completeness of the dilation system $\{\varphi(kx):k=1,2,\cdots\}$ generated by
the odd periodic extension on $\mathbb{R}$ of any $\varphi\in L^2[0,1]$. Up to
now there has been no explicit description of solutions of the Beurling-Wintner
problem even for characteristic functions. We focus on characteristic function
$\mathbf{1}_V$ of an open subset $V$ of $(0,1)$ where $V$ is the union of
finitely many intervals with rational endpoints. Using substantially techniques
from analytic number theory, we fully solved the Beurling-Wintner problem in
most interesting situations and exhibit the explicit form of such $V$. As a
consequence, it yields a complete solution for the rational version of Kozlov's
problem. Moreover, we find that the Beurling-Wintner problem is closely related
to the Twin Prime Conjecture and the Sophie Germain Prime Conjecture.
