We give a constructive proof of the fact that for any sequence of positive integers
n
1
,
n
2
,
…
,
n
N
{n_1},{n_2}, \ldots ,{n_N}
there is a subsequence
m
1
,
…
,
m
r
{m_1}, \ldots ,{m_r}
for which
\[
−
min
x
∑
1
r
cos
m
j
x
≥
C
N
,
- \min \limits _x \sum \limits _1^r {\cos {m_j}x \geq CN,}
\]
where C is a positive constant. Uchiyama previously proved the above inequality with the right-hand side replaced by
C
N
C\sqrt N
. We give a polynomial time algorithm for the selection of the subsequence
m
j
{m_j}
.