Cross-posting notice: This question is also posted on Math Stack Exchange: "Bounding a sum over primitive character"
I'm trying to obtain the upper bound of the sum $$ S= \sum_{\chi_s^{\star}} {\overline{\chi_s^{\star}}(\alpha)} \sum_{k=1}^{s} k\, \chi_s^{\star}(k) \prod_{p \mid t} \left( 1 - \chi_s^{\star}(p) \right), $$ where:
- $s$ and $t$ are two coprime square-free integers,
- $\alpha$ is an integer coprime to $s$, and
- $\chi_s^{\star}$ denotes a primitive Dirichlet character modulo $s$.
Numerically, this sum appears to be much smaller than expected.
Question: Is it possible to obtain a sharp bound for this sum?
Below is my attempt:
Attempt 1:
By the Cauchy–Schwarz inequality, $$ \lvert S \rvert \le \left(\sum_{\chi_s^{\star}} \Bigl|\sum_{k=1}^{s} k\,\chi_s^{\star}(k)\Bigr|^2\right)^{\frac{1}{2}} \left(\sum_{\chi_s^{\star}} \Bigl|\sum_{d \mid t} \mu(d)\,\chi_s^{\star}(d)\Bigr|^2\right)^{\frac{1}{2}}, $$ which leads to, after some treating of the bilinear sum, the bound $$ \lvert S \rvert \le \frac{1}{\sqrt{3}}\, d(t)^{\frac{1}{2}}\, s^{\frac{3}{2}}\, \varphi(s) + o\Bigl(d(t)^{\frac{1}{2}}\, s^{\frac{3}{2}}\, \varphi(s)\Bigr). $$
However, this bound is not sharp enough.
Attempt 2:
By the orthogonality of Dirichlet characters and Möbius inversion, $$ \begin{aligned} S &= \sum_{d \mid t} \mu(d) \sum_{k=1}^s k \sum_{\chi_s^{\star}} {\overline{\chi_s^{\star}}(\alpha)}\, \chi_s^{\star}(k d) \\ &= \sum_{d \mid t} \mu(d) \sum_{k=1}^s k \sum_{\substack{q \mid s \\ \alpha \equiv k d \, (\bmod\, q)}} \mu(q)\, \varphi(q), \end{aligned} $$ which leads to $$ S = \sum_{d \mid t} \mu(d) \sum_{k=1}^{s} k \prod_{p \mid (s,\, \alpha - k d)} \left(2 - p\right) $$ or $$ S = \sum_{q \mid s} \mu(q) \varphi(q) \sum_{d \mid t} \mu(d) \sum_{\substack{k=1 \\ (k,s)=1 \\ k \equiv d^{-1}\alpha \, (\bmod\, q)}}^{s} k. $$
However, I have not been able to further treat either of these forms.