If $\,\lim_{p\to\infty} \sum_{j=1}^n a_j\cos(p\pi \theta_j) \to 0,\,$ then $\,a_1 = \dots = a_n = 0$. The exercise
Let $n \geq 1$, $0 < \theta_1 < \dots < \theta_n < 1$ and $a_1, \dots, a_n \in \mathbb{R}^n$. Assume $ \sum_{j=1}^n a_j\cos(\pi p \theta_j) \underset{p \to +\infty}{\longrightarrow} 0$ ($p \in \mathbb{N}$). Show $a_1 = \dots = a_n = 0$.
My try
I tried to prove this by induction over $n$. I succeeded for $n = 1$, but I have no clue to show how the property can be used for $n \geq 2$.
 A: $\left(\cos(\pi p\vartheta_1)\right)_{p\geqslant 0}$ is bounded, thus there exists $\sigma_1:\mathbb{N}\rightarrow\mathbb{N}$ and $\ell_1\in[-1,1]$ such that $\lim\limits_{p\rightarrow +\infty}\cos\left(\pi\sigma_1(p)\vartheta_1\right)=\ell_1$. By the same argument, since $\left(\cos\left(\pi\sigma_1(p)\vartheta_2\right)\right)_{p\geqslant 1}$ is bounded, there exists $\sigma_2:\mathbb{N}\rightarrow\mathbb{N}$ and $\ell_2\in[-1,1]$ such that $\lim\limits_{p\rightarrow +\infty}\cos\left(\pi(\sigma_1\circ\sigma_2)(p)\vartheta_2\right)=\ell_2$, and we also have $\lim\limits_{p\rightarrow +\infty}\cos\left(\pi(\sigma_1\circ\sigma_2)(p)\vartheta_1\right)=\ell_1$. We do the same for $\ell_3,\ldots,\ell_n$. Let $\sigma=\sigma_1\circ\ldots\circ\sigma_n$, then $\lim\limits_{p\rightarrow +\infty}\cos\left(\pi\sigma(p)\vartheta_j\right)=\ell_j$ for all $j$ and, we can suppose without loss of generality that $(\sigma(p+1)-\sigma(p))_{p\geqslant 0}$ is a nondecreasing sequence. Since $\sin\left(\pi\sigma(p)\vartheta_j\right)=\pm\sqrt{1-\cos^2\left(\pi\sigma(p)\vartheta_j\right)}\underset{p\rightarrow+\infty}{\longrightarrow}\pm\sqrt{1-\ell_j^2}$ we have
$$ \cos\left(\pi\left(\sigma(p+1)-\sigma(p)\right)\vartheta_j\right)=\cos\left(\pi\sigma(p+1)\vartheta_j\right)\cos\left(\pi\sigma(p)\vartheta_j\right)+\sin\left(\pi\sigma(p+1)\vartheta_j\right)\sin\left(\pi\sigma(p)\vartheta_j\right)\underset{p\rightarrow +\infty}{\longrightarrow}\ell_j^2+\left(\pm\sqrt{1-\ell_j^2}\right)^2=1 $$
thus we finally get
$$ \lim\limits_{p\rightarrow +\infty}\sum_{j=1}^n a_j\cos\left(\pi\left(\sigma(p+1)-\sigma(p)\right)\vartheta_j\right)={\rm Card}\{j\in[\![1,n]\!],a_j\neq 0 \} $$
But since $\displaystyle\lim\limits_{p\rightarrow +\infty}\sum_{j=1}^n a_j\cos(\pi p\vartheta_j)=0$, we have $a_j=0$ for all $j$.
A: We shall prove something slightly more general:
If $\,0<\theta_1<\cdots<\theta_n<1$ and
$$
\lim_{p\to\infty}\sum_{j=1}^n \big(a_j\cos(p\pi \theta_j)+b_j\sin(p\pi \theta_j)\big)=0,
$$
then $a_1=b_1=a_2=b_2\cdots=a_n=b_n=0$.
Clearly
$$
\sum_{j=1}^n \big(a_j\cos(p\pi \theta_j)+b_j\sin(p\pi \theta_j)\big)
=\sum_{j=1}^n c_j\mathrm{e}^{ip\pi\theta_j}+
\sum_{j=1}^n \overline{c}_j\mathrm{e}^{-ip\pi\theta_j},
$$
where
$c_j=\frac{a_j-ib_j}{2}$, and hence it suffices to show that $c_1=\cdots=c_n=0$.
Note that the $2n$ complex numbers
$$
\mathrm{e}^{i\pi\theta_j},\mathrm{e}^{-i\pi\theta_j},\quad j=1,\ldots,n,
$$
and distinct. Each of them of absolute value 1.
Hence it suffices to show the following:
If $w_j\in\mathbb C$, $j=1,\ldots,m$, are distinct complex numbers, with $|w_j|=1$, $j=1,\ldots,m$, and
$$
\lim_{p\to\infty}\sum_{j=1}^m d_jw_j^p=0,
$$
then $d_1=\cdots=d_m=0$.
This can be shown inductively on $m$. For $m=1$ it is obvious. Assume that it is true for $m=k-1$ and we have that $\,\lim_{p\to\infty}\sum_{j=1}^k d_jw_j^p=0$. Then
$$
0=w_k\lim_{p\to\infty}\sum_{j=1}^k d_jw_j^p-\lim_{p\to\infty}\sum_{j=1}^k d_jw_j^{p+1}=
\lim_{p\to\infty}\left(w_k\sum_{j=1}^k d_jw_j^p-\sum_{j=1}^k d_jw_j^{p+1}\right) \\
=\lim_{p\to\infty} \sum_{j=1}^{m-1} d_j(w_k-w_j)w_j^p.
$$
Using the induction hypothesis, we obtain that
$$
d_j(w_k-w_j)=0, \quad j=1,\ldots,k-1
$$
and hence $d_j=0$, $j=1,\ldots,k-1$, which implies also that $d_k=0$.
