the best constant in an inequality? I learnt how to show the below inequality by C-S inequality: k is from $0$ to $\infty$
If $\sum a_{k}^{2}9^{k}\le 5$ then $\sum |a_{k}|2^{k}\le 3$.
next,I tried to show that 3 is the best possible constant in the last inequality.
Could you please help me to show how 3 is the best possible constant.
 A: Lemma. If $\omega>1$, and $\{b_n\}_{n\in\mathbb N}\subset \mathbb R$, then
$$
(\omega^2-1)\Big(\sum_{k=1}^\infty \lvert b_k\rvert\Big)^2\le \sum_{k=1}^\infty \omega^{2k}b^2_k,
$$
and $\omega^2-1$ is the optimal constant.
Proof. Using Cauchy-Schwarz (which is a special case for Hölder's inequality for $p=q=2$) we obtain
\begin{align}
\Big(\sum_{k=1}^N \lvert b_k\rvert\Big)^2&=
\Big(\sum_{k=1}^N \omega^{-k}\big(\omega^{k}\lvert b_k\rvert\big)\Big)^2
\le \Big(\sum_{k=1}^N\omega^{-2k}\Big)\Big(\sum_{k=1}^N\omega^{2k}b_k^2\Big) \\&=\frac{\omega^{-2}-\omega^{-2N}}{1-\omega^{-2}}\Big(\sum_{k=1}^N\omega^{2k}b_k^2\Big) \le \frac{\omega^{-2}}{1-\omega^{-2}}\Big(\sum_{k=1}^N\omega^{2k}b_k^2\Big) \\&=\frac{1}{\omega^{2}-1}\Big(\sum_{k=1}^N\omega^{2k}b_k^2\Big)\le \frac{1}{\omega^{2}-1}\Big(\sum_{k=1}^\infty\omega^{2k}b_k^2\Big).
\end{align}
Thus
$$
\Big(\sum_{k=1}^N\omega^{-2k}\Big)\Big(\sum_{k=1}^\infty\omega^{2k}b_k^2\Big) \le
(\omega^{2}-1)\Big(\sum_{k=1}^\infty\omega^{2k}b_k^2\Big). \tag*{$\Box$}
$$
In our case, $\omega=3/2$ and $b_k=2^ka_k$: 
$$
5\ge\sum_{k=1}^\infty a^2_k9^k=\sum_{k=1}^\infty (2^ka_k)^2(3^k/2^k)^2\ge \Big((3/2)^2-1\Big)
\Big(\sum_{k=1}^\infty 2^k\lvert a_k\rvert\Big)^2=\frac{5}{4}
\Big(\sum_{k=1}^\infty 2^k\lvert a_k\rvert\Big)^2.
$$
and hence
$$
\sum_{k=1}2^k\lvert a_k\rvert\ \le 2,
$$
and $2$ is the best estimate.
A: Let $b_k=3^ka_k$, then Cauchy-Schwarz says
$$
\begin{align}
\sum_{k=1}^na_k2^k
&=\sum_{k=1}^nb_k\left(\frac23\right)^k\\
&\le\left(\sum_{k=1}^nb_k^2\right)^{1/2}\left(\sum_{k=1}^n\left(\frac49\right)^k\right)^{1/2}\\
&=\left(\sum_{k=1}^na_k^29^k\right)^{1/2}\frac2{\sqrt5}\sqrt{1-\left(\frac49\right)^n}\\
&=2\sqrt{1-\left(\frac49\right)^n}\tag{5}
\end{align}
$$
Note that equality holds in $(5)$ when $b_k=\lambda\left(\frac23\right)^k$ for some lambda; that is, when $a_k=\lambda\left(\frac29\right)^k$. This gives us
$$
a_k=\frac{\frac52}{\sqrt{1-\left(\frac49\right)^n}}\left(\frac29\right)^k\tag{6}
$$
which shows that $(5)$ is sharp.
