[step:Decompose the full average by primitive conductor]
We prove that, for every $q\in\mathbb N$,
\begin{align*}
B(q)=\sum_{d\mid q}A_{s,k,N}(d).
\end{align*}
The case $q=1$ is immediate, since $B(1)=M_{s,k}(N;1)=1=A_{s,k,N}(1)$.
Assume $q\ge2$. For each residue class $a\in\mathbb Z/q\mathbb Z$, choose an integer representative, still denoted $a$, and put
\begin{align*}
g:=\gcd(a,q),\qquad d:=\frac{q}{g},\qquad b:=\frac{a}{g}.
\end{align*}
If $a\equiv0\pmod q$, then $d=1$. Otherwise $d\mid q$ and $\gcd(b,d)=1$, and
\begin{align*}
\frac{a}{q}=\frac{b}{d}.
\end{align*}
Conversely, for each divisor $d\mid q$ and each class $b\in\mathbb Z/d\mathbb Z$ with $\gcd(b,d)=1$, the class $a=(q/d)b\in\mathbb Z/q\mathbb Z$ has primitive conductor $d$.
For such a pair $(d,b)$, the natural reduction map
\begin{align*}
\mathbb Z/q\mathbb Z\to\mathbb Z/d\mathbb Z
\end{align*}
has exactly $q/d$ preimages over each residue class. Hence
\begin{align*}
C_k(q,a)
=
\sum_{r\in\mathbb Z/q\mathbb Z}e\left(\frac{br^k}{d}\right)
=
\frac{q}{d}\sum_{u\in\mathbb Z/d\mathbb Z}e\left(\frac{bu^k}{d}\right)
=
\frac{q}{d}C_k(d,b).
\end{align*}
Also
\begin{align*}
e\left(-\frac{aN}{q}\right)=e\left(-\frac{bN}{d}\right).
\end{align*}
Substituting this conductor parametrisation into the formula for $B(q)$ gives
\begin{align*}
B(q)
=
q^{-s}\sum_{d\mid q}\sum_{\substack{b\in\mathbb Z/d\mathbb Z, \gcd(b, d)=1}}
\left(\frac{q}{d}C_k(d,b)\right)^s
e\left(-\frac{bN}{d}\right).
\end{align*}
The contribution of $d=1$ is $1=A_{s,k,N}(1)$, and for $d\ge2$ the inner expression is exactly $A_{s,k,N}(d)$. Therefore
\begin{align*}
B(q)=\sum_{d\mid q}A_{s,k,N}(d).
\end{align*}
[/step]