TITLE: Linear combination of $\cos nx$ with integer coefficients having small absolute values in a given range
QUESTION [6 upvotes]: I want to find a linear combination of $\cos nx$, $n\ge 0$ (so it's an even trigonometric polynomial) with integer coefficients having small absolute values in a given range. To be specific, I want to find $a_0,a_1,\cdots,a_m \in \mathbb{Z}$ (not all of them zero) such that $f(x)=a_0+a_1 \cos x + \cdots + a_m \cos mx$ satisfies $|f(x)|<1$ for all $x\in I$, where an interval (or a finite union of intervals) $I$ is given. 
Because of the symmetry, WLOG we can assume that $I \subset [0,\pi]$. For example, $f(x)=1+2\cos x + 2\cos 2x - 2\cos 4x - 2\cos 5x$ satisfies $|f(x)|<1$ for $x \in [2,\pi]$. It will be helpful for me if one can find such $f$ for "longer" $I$.
(EDIT: I'd like to exclude the simplest cases, monomials $\cos mx$.)

REPLY [3 votes]: This is only a trivial elaboration of G Cab's good idea. The Dirichlet kernel 
$$
D_n(x)=1+2\sum_{k=1}^n \cos(kx)=\frac{\sin( (n+\frac12)x)}{\sin \frac{x}{2}} $$ 
is a linear combination of cosines with integer coefficients and it has the property that 
$$\lim_{n\to \infty} \sup_{|x|>\delta} |D_n(x)| =0.$$ 
In particular, for any fixed $\delta>0$, there exists a degree $N(\delta)$ such that $|D_n(x)|<1$ for $x\in [-\pi, -\delta] \cup [\delta, \pi]$ and $n\ge N(\delta)$.