  In the present paper, we study the limit sets of the almost periodic
functions $f(x)$. It is interesting that the values $r=\inf|f(x)|$ and
$R=\sup|f(x)|$ may be expressed in the exact form. We show that the ring $r\leq
|z|\leq R$ is the limit set of the almost periodic function $f(x)$ (under some
natural conditions on $f$). The exact expression for $r$ coincides with the
well known partition problem formula and gives a new analytical method of
solving the corresponding partition problem. Several interesting examples are
considered. For instance, in the case of the five numbers, the well-known
Karmarkar--Karp algorithm gives the value $m=2$ as the solution of the
partition problem in our example, and our method gives the correct answer
$m=0.$ The figures presented in Appendix illustrate our results.
