\section{A divisor-weighted sieve estimate}\label{sec:sieve} The coefficients $\lambda_\eta(n)$ are bounded by $\tau(n)$, but need not be bounded independently of $n$. We therefore estimate the error of the upper sieve with the divisor weight still present. The normalization by $m_W$ will allow us subsequently to remove the marking array. \subsection{The sieve polynomials} Put $z=x^\gamma$, where $\gamma>0$ is fixed, and let $h$ be an even positive integer. Partition the primes at most $z$ into the nonempty blocks \[ \mathcal B_j=\{p:z^{2^{-j-1}}z}\le E_h(n),\qquad E_h(n)\ge0. \end{equation} Here $P^-(n)$ denotes the least prime factor of $n$, with $P^-(1)=\infty$. Every polynomial in \eqref{eq:sieve-polynomials} is a sum of squarefree divisor indicators with coefficients of absolute value at most one. Indeed, the correction indexed by $j$ has degree exactly $h_j+1$ in block $j$ and degree at most $h_k$ in every other block. Thus the correction supports are pairwise disjoint and are disjoint from the support of $U_h$. Since \[ \sum_{j\ge0}h_j2^{-j}=4h, \] all the divisors that occur are at most $z^{4h+2}$. In particular, writing \begin{equation}\label{eq:sieve-divisors} E_h(n)=\sum_{r\mid n}e_r, \qquad |e_r|\le1, \qquad e_r=0\quad\hbox{unless $r$ is squarefree and $r\le z^{4h+2}$}, \end{equation} we have $E_h(n)\le\tau(n)$. \begin{proposition}[Divisor-weighted upper-sieve error]\label{prop:envelope} Let $\Phi\ge0$ be smooth with compact support in $(0,\infty)$, and let $W$ be a fixed marking array with independent-model mean $m_W$. Fix $c<1/4$, and suppose that $\gamma(4h+2)\le c$. For all sufficiently large even $h$, \begin{equation}\label{eq:envelope-bound} \limsup_{x\to\infty}\frac{\log x}{x m_W} \sum_n\Phi\!\left(\frac{n-1}{x}\right) W(n-1)\tau(n)E_h(n) \ll_\Phi \frac{e^{-h}}{\gamma^2}. \end{equation} The implied constant is independent of the number and locations of the fixed marking bands. Error terms tending to zero with $x$ may depend on these bands, on $h$, and on $\gamma$. \end{proposition} \begin{proof} We first bound the expectation of $E_h$ for the local densities imposed by the divisor function. For $s$ near $1$, let \[ g_s(p)=2p^{-s}-p^{-2s},\qquad \mathcal M_h(s)=\sum_r e_rg_s(r),\qquad P_2(z)=\prod_{p\le z}(1-p^{-1})^2, \] where $g_s$ is extended multiplicatively to squarefree integers. For block $j$, let \[ A_j(s)=\prod_{p\in\mathcal B_j}(1-g_s(p)), \] and let $u_j(s)$ and $e_j(s)$ be the elementary-symmetric expressions obtained from $U_j$ and $E_j$ by replacing $\mathbf1_{p\mid n}$ by $g_s(p)$. The exact identity \eqref{eq:sieve-polynomials} becomes \begin{equation}\label{eq:block-expectation} \mathcal M_h(s)=\sum_j e_j(s)\prod_{k\ne j}u_k(s). \end{equation} Choose a sufficiently small absolute $b>0$. Uniformly on $|s-1|\le b/\log z$, we have \[ |g_s(p)|\ll p^{-1},\qquad |g_s(p)-g_1(p)|\ll \frac{b\log p}{p\log z}. \] The reciprocal prime mass of each block is bounded by an absolute constant. Also $1-g_1(p)=(1-p^{-1})^2\ge1/4$. Taking logarithms therefore shows that \[ \left|\frac{A_j(s)}{A_j(1)}\right|, \left|\frac{A_j(1)}{A_j(s)}\right| \le \exp(Cb2^{-j}). \] Each $|A_j(s)|$ is bounded below by a positive absolute constant, and $\prod_j|A_j(s)|\ll P_2(z)$. On the other hand, \[ |e_j(s)|\le\frac{C^{h_j+1}}{(h_j+1)!},\qquad |u_j(s)-A_j(s)|\le\sum_{a>h_j}\frac{C^a}{a!}. \] The factorial tails, summed over $h_j=(j+1)h$, are $O(e^{-h})$ once $h$ exceeds an absolute constant. Substitution into \eqref{eq:block-expectation}, followed by Cauchy's estimate on a smaller disk, yields \begin{equation}\label{eq:sieve-model-bounds} |\mathcal M_h(1)|\ll e^{-h}P_2(z),\qquad |\mathcal M_h'(1)|\ll (\log z)e^{-h}P_2(z). \end{equation} The same argument gives $\sup_{|s-1|\le b/\log z}|\mathcal M_h(s)|\ll e^{-h}P_2(z)$. It applies to complex $s$ because it uses the polynomial identity and absolute elementary-symmetric bounds. Next fix squarefree integers $d,r$ with $(d,r)=1$. Orthogonality of Dirichlet characters gives, initially for $\Re s>1$, \begin{align} &\sum_{\substack{n\ge1\\r\mid n\\n\equiv1\pmod d}} \frac{\tau(n)}{n^s}\notag\\ &\qquad= \frac{r^{-s}}{\varphi(d)} \sum_{\vartheta\bmod d}\vartheta(r)L(s,\vartheta)^2 \prod_{p\mid r}(2-\vartheta(p)p^{-s}). \label{eq:divisor-progression-series} \end{align} To check the factor at $p\mid r$, use $\sum_{a\ge0}\tau(p^{a+1})t^a=(2-t)/(1-t)^2$. If $(d,r)>1$, the original divisibility conditions are incompatible. The principal-character term of \eqref{eq:divisor-progression-series} is exactly \begin{equation}\label{eq:principal-pole-factor} \zeta(s)^2g_s(r)h_s(d),\qquad h_s(d)=\prod_{p\mid d}\frac{(1-p^{-s})^2}{p-1}. \end{equation} In particular, \begin{equation}\label{eq:mark-divisor-density} h_1(p)=\frac1p-\frac1{p^2}. \end{equation} Write $\Phi_x(t)=\Phi(t-x^{-1})$, so that $\Phi_x(n/x)=\Phi((n-1)/x)$. Its smooth seminorms are bounded uniformly for large $x$. Put $\widehat\Phi_x(s)=\int_0^\infty\Phi_x(t)t^{s-1}\,dt$. Mellin inversion in \eqref{eq:divisor-progression-series}, followed by a shift to $\Re s=3/4$, crosses only the double pole of the principal term at $1$. The standard polynomial bounds for Dirichlet $L$-functions on this fixed strip and the rapid decay of $\widehat\Phi_x$ bound the remaining integral by \begin{equation}\label{eq:divisor-contour-error} O_\Phi\!\left(x^{3/4}d^{C}3^{\omega(r)}r^{-3/4}\right) \end{equation} for an absolute fixed $C$. Apply Lemma~\ref{lem:array-truncation} to write \[ W_0(u)=\sum_d c_d\mathbf1_{d\mid u},\qquad |W(u)-W_0(u)|\le E_{\mathrm{arr}}(u),\qquad \max d=x^{o(1)},\quad \sum_d|c_d|=x^{o(1)}. \] All these $d$ are squarefree. With $h_0=\lfloor(\log x)^{0.01}\rfloor$, the second-moment bound in that lemma is \[ \sum_{u\asymp x}E_{\mathrm{arr}}(u)^2 \ll x h_0^{O_W(1)}\frac{C_W^{h_0}}{h_0!}+x^{o(1)}. \] Since $0\le E_h(n)\le\tau(n)$, Cauchy's inequality and $\sum_{n\asymp x}\tau(n)^4\ll x(\log x)^{15}$ show that replacing $W$ by $W_0$ in the sum of the proposition costs \begin{equation}\label{eq:sieve-array-error} \ll_\Phi\sum_{n\asymp x}\tau(n)^2E_{\mathrm{arr}}(n-1) \ll_{A,W}x(\log x)^{-A} \end{equation} for every fixed $A>0$. This estimate treats the whole polynomial $E_h$ at once. The contour errors \eqref{eq:divisor-contour-error}, summed over $r\le x^c$ and the retained $d$, are $O(x^{3/4+c/4+o(1)})$. It remains to compute the sum of the pole contributions. Their holomorphic factor is \begin{equation}\label{eq:joint-pole} \mathcal J_h(s)=\sum_r e_rg_s(r) \sum_{\substack{d\\(d,r)=1}}c_dh_s(d). \end{equation} We claim that, uniformly for $|s-1|\le b/\log z$, \begin{equation}\label{eq:joint-pole-mean} \mathcal J_h(s)=m_W\mathcal M_h(s)+O_{A,W,h,\gamma}((\log x)^{-A}) \end{equation} for every fixed $A$. Indeed, at a marking prime $p$, $h_s(p)=p^{-1}+O(p^{-2})$ on this disk. The polynomial expectation of the fixed array at these parameters consequently differs from its independent-model mean by $O_W(\sum_{p\text{ marking}}p^{-2})$. This follows either by changing one local factor at a time in its absolutely convergent divisor expansion, or by the corresponding finite polynomial identity for the truncated array. Excluding a marking prime that divides $r$ changes the expectation by at most \[ O_W\!\left(\sum_{\substack{p\mid r\\p\text{ marking}}}\frac1p\right) \ll_W (\log x)\exp\!\bigl(- (\log x)^{0.1}\bigr). \] Both errors decrease faster than every negative power of $\log x$. The model truncation has the same factorial tail as the physical truncation. Finally, \[ \sum_r|e_rg_s(r)|\le\prod_{p\le z}(1+|g_s(p)|) \ll (\log z)^C. \] Multiplying the preceding errors by this bound proves \eqref{eq:joint-pole-mean}. The argument is valid for complex local parameters by the same absolute polynomial estimates. Cauchy's estimate gives its differentiated version at $s=1$, losing only a factor $\log z$. The required residue is now that of $x^s\widehat\Phi_x(s)\zeta(s)^2\mathcal J_h(s)$ at $s=1$. Writing $\gamma_E$ for Euler's constant, it equals \begin{align} x m_W\bigl\{&[(\log x)\widehat\Phi_x(1)+\widehat\Phi_x'(1) +2\gamma_E\widehat\Phi_x(1)]\mathcal M_h(1) \notag\\ &\hspace{25mm}+\widehat\Phi_x(1)\mathcal M_h'(1)\bigr\} +O_{A,W,h,\gamma}(x(\log x)^{-A}). \label{eq:divisor-residue} \end{align} Mertens' estimate gives $P_2(z)\ll(\log z)^{-2}$. Using \eqref{eq:sieve-model-bounds}, $\log z=\gamma\log x$, the contour error, and \eqref{eq:sieve-array-error}, we conclude that \[ \sum_n\Phi\!\left(\frac{n-1}{x}\right)W(n-1)\tau(n)E_h(n) \ll_\Phi\frac{x m_We^{-h}}{\gamma^2\log x} +o_{W,h,\gamma}(x/\log x). \] Here $\gamma<1/4$, so the derivative term, which costs $1/\gamma$ after normalization, is covered by $1/\gamma^2$. For fixed $W$, its mean is bounded away from zero; dividing and taking the limit proves the proposition, with the stated uniformity. \end{proof} \begin{corollary}[The marked rough sum]\label{cor:rough-sum} Fix the giant-factor interval and $\eps$ as above, and put $c=\eps/64$. For each sufficiently large even $h$, set $\gamma=c/(4h+3)$. For every fixed marking array $W$, \begin{equation}\label{eq:presieve} \limsup_{x\to\infty}\frac{\log x}{x m_W} \left|\sum_{P^-(n)>x^\gamma} \Phi\!\left(\frac{n-1}{x}\right)W(n-1) (f_x(n-1)-C_x)\lambda_\eta(n)\chi(n)\right| \ll_{\Phi,\eps}\frac{e^{-h}}{\gamma^2}. \end{equation} The surviving constant is independent of the marking bands. \end{corollary} \begin{proof} The upper polynomial $U_h(n)$ has divisor coefficients of absolute value at most one and level $z^{4h+2}\le x^c$. Proposition~\ref{prop:sampling} therefore gives \[ \sum_n\Phi\!\left(\frac{n-1}{x}\right)W(n-1) (f_x(n-1)-C_x)\lambda_\eta(n)\chi(n)U_h(n) =o(x/\log x). \] On the support of $\Phi$, the centered statistic $f_x-C_x$ is bounded by a constant depending only on $\eps$. The absolute error in replacing $U_h$ by $\mathbf1_{P^-(n)>z}$ is bounded by that constant times the sum in Proposition~\ref{prop:envelope}, because $|\lambda_\eta(n)\chi(n)|\le\tau(n)$ and \eqref{eq:sieve-pointwise} holds. This proves \eqref{eq:presieve}. \end{proof} \section{Extraction of the prime trace}\label{sec:extraction} We next remove composites from the rough sum. The prime coefficient has zero mean in every Dirichlet test by Lemma~\ref{lem:prime-tests}. Consequently the marked bilinear estimate removes the composite terms directly. \begin{proposition}[Prime extraction]\label{prop:extraction} Let $0<\gamma<1/2$ be fixed, and put $a(n)=\lambda_\eta(n)\chi(n)$. Let $G_x$ be bounded uniformly on the support of $\Phi(u/x)$ and invariant under multiplication by every marking prime. For a marking array $W$ with sufficiently many bands, \begin{align} &\sum_{p\ \mathrm{prime}}\Phi\!\left(\frac{p-1}{x}\right) W(p-1)G_x(p-1)a(p)\notag\\ &\qquad= \sum_{P^-(n)>x^\gamma}\Phi\!\left(\frac{n-1}{x}\right) W(n-1)G_x(n-1)a(n)+o(x/\log x). \label{eq:prime-extraction} \end{align} The required number of bands is independent of their fixed exponents. In particular this holds for $G_x=f_x-C_x$. \end{proposition} \begin{proof} Write $z=x^\gamma$ and $J=\lceil2/\gamma\rceil$. For all sufficiently large $x$, a $z$-rough integer on the support has at most $J$ prime factors counted with multiplicity. Hence $|a(n)|\le\tau(n)\le2^J$ there. The number of such integers divisible by the square of a prime greater than $z$ is at most \[ Cx\sum_{q>z}q^{-2}\ll x/z. \] The array and $G_x$ are bounded for fixed parameters, so these integers contribute $O_{\gamma,W}(x^{1-\gamma})=o(x/\log x)$. A remaining composite can be written as a product of $j$ distinct primes, $n=p_1\cdots p_j$, with $2\le j\le J$. Summation over ordered factorizations, with weight $1/j!$, counts it once. Coprime multiplicativity gives $a(n)=\prod_{i=1}^ja(p_i)$. Isolate $m=p_1$ and write $v=p_2\cdots p_j$. The coefficient of $v$ is \[ \beta_j(v)= \sum_{\substack{p_2\cdots p_j=v\\p_i>z}} \prod_{i=2}^ja(p_i), \qquad |\beta_j(v)|\le 2^{j-1}(j-1)!. \] We may temporarily allow repeated primes in this expression: their contribution is bounded by the preceding square-divisibility estimate, since both the original weights and the ordered-product weights are bounded in terms of $\gamma$. The coefficient $\beta_j$ is supported on $z$-rough integers and is bounded independently of $x$. Decompose $m$ and $v$ into dyadic intervals. Both variables are at least $x^\gamma$, their product is comparable with $x$, and there are $O((\log x)^2)$ relevant boxes. Replacing $\Phi((mv-1)/x)$ by $\Phi(mv/x)$ costs only a fixed power of $\log x$: the pointwise change is $O_\Phi(x^{-1})$ and the relevant divisor moments have size $x$ times a fixed logarithmic power. Mellin inversion then separates the product cutoff. Its rapidly decaying transform permits restriction to $|t|\le(\log x)^B$, with arbitrarily small logarithmic error after choosing $B$. The first coefficient in a separated box is $\mathbf1_{m\text{ prime}}a(m)m^{it}$. Lemma~\ref{lem:prime-tests} verifies all its Dirichlet tests, including the extra logarithmic frequency $t$. Proposition~\ref{prop:transfer} therefore applies with second coefficient $\beta_j(v)v^{it}$ and core $G_x(mv-1)$. A bounded clipping and rescaling of $G_x$, if necessary, make it globally bounded without changing it on the support. This preserves its marking-prime invariance. For $G_x=f_x-C_x$, that invariance is exact because no marking prime belongs to the giant interval. Every such box is $O_A(x(\log x)^{-A})$ for an arbitrarily prescribed fixed $A$, once sufficiently many bands have been chosen. Choose $A$ to absorb the dyadic decomposition and Mellin truncation. Summing over $j$ proves that the composite contribution is $o(x/\log x)$. All primes on the support exceed $z$ for large $x$, so their contribution to the rough sum is precisely the left side of \eqref{eq:prime-extraction}. \end{proof} \begin{theorem}[Cubic traces and a large prime factor]\label{thm:trace} Let $\eta$ be a fixed nontrivial cubic Hecke character of $F=\Q(\zeta_3)$ satisfying $\eta^\sigma=\eta^{-1}$, and let $\chi$ be any fixed Dirichlet character. For the giant-factor statistic $f_x$, \begin{equation}\label{eq:trace-centered} \sum_{p\ \mathrm{prime}}\Phi\!\left(\frac{p-1}{x}\right) \chi(p)t_\eta(p)(f_x(p-1)-C_x)=o(x/\log x). \end{equation} Consequently, \begin{equation}\label{eq:trace-uncentered} \sum_{p\ \mathrm{prime}}\Phi\!\left(\frac{p-1}{x}\right) \chi(p)t_\eta(p)f_x(p-1)=o(x/\log x). \end{equation} \end{theorem} \begin{proof} We prove the assertion for nonnegative $\Phi$; decomposition into a fixed linear combination of such test functions gives the general smooth version if required. Fix a sufficiently large even $h$, set $c=\eps/64$ and $\gamma=c/(4h+3)$, and choose a sufficient number $K$ of bands for Proposition~\ref{prop:extraction}. Corollary~\ref{cor:rough-sum} and that proposition imply, for every fixed array of this size, \[ \limsup_{x\to\infty}\frac{\log x}{x m_W} \left|\sum_p\Phi\!\left(\frac{p-1}{x}\right)W(p-1) (f_x(p-1)-C_x)a(p)\right| \ll_{\Phi,\eps}\frac{e^{-h}}{\gamma^2}. \] For an arbitrary fixed positive integer $B$, choose $B$ disjoint arrays $W_1,\ldots,W_B$ of size $K$, with means $m_1,\ldots,m_B$, and write \[ A_B(u)=\frac1B\sum_{b=1}^B\frac{W_b(u)}{m_b},\qquad Z_B(u)=|A_B(u)-1|^2. \] The positive prime variance estimate \eqref{eq:array-variance}, proved in \cite[Section~7]{PD}, gives \[ \limsup_{x\to\infty}\frac{\log x}{x} \sum_p\Phi\!\left(\frac{p-1}{x}\right)Z_B(p-1) \ll_\Phi \frac{C_K}{B}. \] At primes $|a(p)|\le2$ and $f_x(p-1)-C_x$ is uniformly bounded on the support. Cauchy's inequality and the usual upper bound for the number of primes thus give \begin{align*} &\left|\sum_p\Phi\!\left(\frac{p-1}{x}\right) (A_B(p-1)-1)(f_x(p-1)-C_x)a(p)\right|\\ &\qquad\ll_{\Phi,\eps} \left(\sum_p\Phi\!\left(\frac{p-1}{x}\right)Z_B(p-1)\right)^{1/2} \left(\sum_p\Phi\!\left(\frac{p-1}{x}\right)\right)^{1/2}. \end{align*} Average the marked bounds over $b$ and take $x\to\infty$ with all these choices fixed. The result is \[ \limsup_{x\to\infty}\frac{\log x}{x} \left|\sum_p\Phi\!\left(\frac{p-1}{x}\right) (f_x(p-1)-C_x)a(p)\right| \ll_{\Phi,\eps}\frac{e^{-h}}{\gamma^2} +O_{\Phi,\eps}\!\left(\sqrt{\frac{C_K}{B}}\right). \] First let $B$ become arbitrarily large with $h$ and $K$ fixed. Then let $h$ tend to infinity. Since $\gamma^{-2}=(4h+3)^2/c^2$, the remaining bound tends to zero. At each stage only finitely many arrays are used before taking the limit in $x$. This proves \eqref{eq:trace-centered}, since $a(p)=\chi(p)t_\eta(p)$ away from finitely many primes. Finally Lemma~\ref{lem:prime-tests}, with the fixed smooth cutoff, gives $\sum_p\Phi((p-1)/x)\chi(p)t_\eta(p)=o(x/\log x)$. As $C_x$ is bounded, subtracting this term from \eqref{eq:trace-centered} proves \eqref{eq:trace-uncentered}. \end{proof}