  Given an integer $g$ and also some given integers $m$ (sufficiently large)
and $c_1,\dots, c_m$, we show that the number of all non-negative integers
$n\le M$ with the property that there exist non-negative integers $k_1,\dots,
k_m$ such that $$n^2=\sum_{i=1}^m c_i g^{k_i}$$ is $o\left(\left(\log M
\right)^{m-1/2}\right)$. We also obtain a similar bound when dealing with more
general inequalities $$\left|Q(n)-\sum_{i=1}^m c_i\lambda^{k_i}\right|\le B,$$
where $Q\in {\mathbb C}[X]$ and also $\lambda\in {\mathbb C}$ (while $B$ is a
real number).
