[proofplan]
We first compare the congruence count with a complete exponential average by additive-character orthogonality modulo $q$. Then we decompose that full average according to the primitive conductor of the rational number $a/q$, obtaining the divisor identity $q^{1-s}M_{s,k}(N;q)=\sum_{d\mid q}A_{s,k,N}(d)$. The [Chinese remainder theorem](/theorems/734) gives multiplicativity of the primitive coefficients $A_{s,k,N}(q)$, and the divisor identity along prime powers identifies the local density as the sum of the corresponding local primitive increments. Finally, absolute convergence permits the usual Euler product passage from the multiplicative series to the product of its prime-power sums.
[/proofplan]
[step:Convert the congruence count into a complete exponential average]
Define the normalization map
\begin{align*}
B:\mathbb N &\to \mathbb C
\end{align*}
by
\begin{align*}
B(q):=q^{1-s}M_{s,k}(N;q).
\end{align*}
We claim that
\begin{align*}
B(q)=q^{-s}\sum_{a\in\mathbb Z/q\mathbb Z}C_k(q,a)^s e\left(-\frac{aN}{q}\right).
\end{align*}
For $t\in\mathbb Z$, the finite additive-character average satisfies
\begin{align*}
\frac{1}{q}\sum_{a\in\mathbb Z/q\mathbb Z}e\left(\frac{at}{q}\right)=1 \qquad \text{if } t\equiv 0\pmod q.
\end{align*}
Moreover,
\begin{align*}
\frac{1}{q}\sum_{a\in\mathbb Z/q\mathbb Z}e\left(\frac{at}{q}\right)=0 \qquad \text{if } t\not\equiv 0\pmod q.
\end{align*}
Indeed, if $t\equiv0\pmod q$, every summand is $1$. If $t\not\equiv0\pmod q$, the ratio $e(t/q)$ is not $1$, and the finite geometric sum is $0$.
Expanding the $s$-th power of $C_k(q,a)$ gives
\begin{align*}
C_k(q,a)^s
=
\sum_{(x_1,\dots,x_s)\in(\mathbb Z/q\mathbb Z)^s}
e\left(\frac{a(x_1^k+\cdots+x_s^k)}{q}\right).
\end{align*}
Therefore
\begin{align*}
q^{-s}\sum_{a\in\mathbb Z/q\mathbb Z}C_k(q,a)^s e\left(-\frac{aN}{q}\right)
=
q^{-s}\sum_{(x_1,\dots,x_s)\in(\mathbb Z/q\mathbb Z)^s}
\sum_{a\in\mathbb Z/q\mathbb Z}
e\left(\frac{a(x_1^k+\cdots+x_s^k-N)}{q}\right).
\end{align*}
By the orthogonality identity just proved, the inner sum equals $q$ exactly for those tuples satisfying
\begin{align*}
x_1^k+\cdots+x_s^k\equiv N\pmod q,
\end{align*}
and equals $0$ otherwise. Hence the last displayed expression is
\begin{align*}
q^{-s}qM_{s,k}(N;q)=q^{1-s}M_{s,k}(N;q)=B(q).
\end{align*}
[guided]
The point of this step is to replace a congruence condition by an average over additive characters. Define the normalization map
\begin{align*}
B:\mathbb N &\to \mathbb C
\end{align*}
by
\begin{align*}
B(q):=q^{1-s}M_{s,k}(N;q).
\end{align*}
We prove that $B(q)$ is exactly the full complete exponential average
\begin{align*}
q^{-s}\sum_{a\in\mathbb Z/q\mathbb Z}C_k(q,a)^s e\left(-\frac{aN}{q}\right).
\end{align*}
The basic identity is the orthogonality of additive characters modulo $q$. For each integer $t\in\mathbb Z$ with $t\equiv0\pmod q$,
\begin{align*}
\frac{1}{q}\sum_{a\in\mathbb Z/q\mathbb Z}e\left(\frac{at}{q}\right)=1.
\end{align*}
For each integer $t\in\mathbb Z$ with $t\not\equiv0\pmod q$,
\begin{align*}
\frac{1}{q}\sum_{a\in\mathbb Z/q\mathbb Z}e\left(\frac{at}{q}\right)=0.
\end{align*}
When $t\equiv0\pmod q$, each summand is $e(0)=1$. When $t\not\equiv0\pmod q$, the number $e(t/q)$ is a nontrivial $q$-th root of unity, so the finite geometric sum over $a\in\mathbb Z/q\mathbb Z$ vanishes.
Now expand the power of the complete Weyl sum. Since
\begin{align*}
C_k(q,a)=\sum_{r\in\mathbb Z/q\mathbb Z} e\left(\frac{ar^k}{q}\right),
\end{align*}
multiplying $s$ copies gives
\begin{align*}
C_k(q,a)^s
=
\sum_{(x_1,\dots,x_s)\in(\mathbb Z/q\mathbb Z)^s}
e\left(\frac{a(x_1^k+\cdots+x_s^k)}{q}\right).
\end{align*}
After multiplying by $e(-aN/q)$ and summing over $a$, we get
\begin{align*}
q^{-s}\sum_{a\in\mathbb Z/q\mathbb Z}C_k(q,a)^s e\left(-\frac{aN}{q}\right)
=
q^{-s}\sum_{(x_1,\dots,x_s)\in(\mathbb Z/q\mathbb Z)^s}
\sum_{a\in\mathbb Z/q\mathbb Z}
e\left(\frac{a(x_1^k+\cdots+x_s^k-N)}{q}\right).
\end{align*}
The inner sum is a detector for the congruence
\begin{align*}
x_1^k+\cdots+x_s^k\equiv N\pmod q.
\end{align*}
It contributes $q$ for each tuple counted by $M_{s,k}(N;q)$ and contributes $0$ for every other tuple. Thus the full average equals
\begin{align*}
q^{-s}qM_{s,k}(N;q)=q^{1-s}M_{s,k}(N;q)=B(q).
\end{align*}
[/guided]
[/step]
[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]
[step:Show that the primitive coefficients are multiplicative]
We prove that if $u,v\in\mathbb N$ and $\gcd(u,v)=1$, then
\begin{align*}
A_{s,k,N}(uv)=A_{s,k,N}(u)A_{s,k,N}(v).
\end{align*}
The assertion is immediate if $u=1$ or $v=1$, so assume $u,v\ge2$.
Let $a\in\mathbb Z/uv\mathbb Z$ be a unit. By the Chinese [remainder theorem](/theorems/1707), there are unique unit classes $a_u\in\mathbb Z/u\mathbb Z$ and $a_v\in\mathbb Z/v\mathbb Z$ satisfying
\begin{align*}
a\equiv va_u+ua_v\pmod {uv}.
\end{align*}
Equivalently, these classes are characterized by the rational congruence
\begin{align*}
\frac{a}{uv}\equiv \frac{a_u}{u}+\frac{a_v}{v}\pmod 1.
\end{align*}
Under the same Chinese remainder bijection, every $r\in\mathbb Z/uv\mathbb Z$ corresponds uniquely to a pair $(r_u,r_v)\in\mathbb Z/u\mathbb Z\times\mathbb Z/v\mathbb Z$. Therefore
\begin{align*}
e\left(\frac{ar^k}{uv}\right)
=
e\left(\frac{a_u r_u^k}{u}\right)e\left(\frac{a_v r_v^k}{v}\right),
\end{align*}
and summing over residue classes gives
\begin{align*}
C_k(uv,a)=C_k(u,a_u)C_k(v,a_v).
\end{align*}
The same congruence relation gives
\begin{align*}
e\left(-\frac{aN}{uv}\right)
=
e\left(-\frac{a_uN}{u}\right)e\left(-\frac{a_vN}{v}\right).
\end{align*}
Thus
\begin{align*}
A_{s,k,N}(uv)
=
(uv)^{-s}
\sum_{\substack{a_u\in\mathbb Z/u\mathbb Z, \gcd(a_u, u)=1}}
\sum_{\substack{a_v\in\mathbb Z/v\mathbb Z, \gcd(a_v, v)=1}}
C_k(u,a_u)^sC_k(v,a_v)^s
e\left(-\frac{a_uN}{u}\right)
e\left(-\frac{a_vN}{v}\right).
\end{align*}
Factoring the finite double sum yields
\begin{align*}
A_{s,k,N}(uv)=A_{s,k,N}(u)A_{s,k,N}(v).
\end{align*}
[/step]
[step:Identify each local density as a prime-power sum]
Let $p$ be a prime. Applying the divisor decomposition to $q=p^h$ gives, for every integer $h\ge0$,
\begin{align*}
p^{h(1-s)}M_{s,k}(N;p^h)=B(p^h)=\sum_{j=0}^{h}A_{s,k,N}(p^j).
\end{align*}
The absolute convergence of
\begin{align*}
\sum_{q=1}^{\infty}A_{s,k,N}(q)
\end{align*}
implies, in particular, the absolute convergence of the subseries
\begin{align*}
\sum_{j=0}^{\infty}A_{s,k,N}(p^j).
\end{align*}
Therefore the sequence of partial sums
\begin{align*}
\sum_{j=0}^{h}A_{s,k,N}(p^j)
\end{align*}
converges as $h\to\infty$. Hence the local density exists and is given by
\begin{align*}
\sigma_p(N)=\sum_{j=0}^{\infty}A_{s,k,N}(p^j).
\end{align*}
[/step]
[step:Pass from the absolutely convergent multiplicative series to the Euler product]
Let $\mathcal P$ denote the set of primes, and for a finite subset $P_0\subset\mathcal P$ define the finite Euler product
\begin{align*}
E(P_0):=\prod_{p\in P_0}\left(\sum_{j=0}^{\infty}A_{s,k,N}(p^j)\right).
\end{align*}
Each factor is absolutely convergent by the previous step. Expanding the finite product and using multiplicativity of $A_{s,k,N}$ gives
\begin{align*}
E(P_0)=\sum_{\substack{q\in\mathbb N, \text{all prime divisors of }q\text{ lie in }P_0}}A_{s,k,N}(q).
\end{align*}
Because the full series
\begin{align*}
\sum_{q=1}^{\infty}A_{s,k,N}(q)
\end{align*}
converges absolutely, it is unconditionally convergent over the countable index set $\mathbb N$. Explicitly, for every $\varepsilon>0$ there is a finite set $F\subset\mathbb N$ such that
\begin{align*}
\sum_{q\in\mathbb N\setminus F}|A_{s,k,N}(q)|<\varepsilon.
\end{align*}
If $P_0$ contains every prime divisor of every integer in $F$, then the sum over integers whose prime divisors lie in $P_0$ contains all terms indexed by $F$, and the omitted tail has absolute value at most $\varepsilon$. Hence the net of finite-prime partial sums converges to the full sum as $P_0$ increases over finite subsets of $\mathcal P$. Therefore
\begin{align*}
\mathfrak S_{s,k}(N)
=
\sum_{q=1}^{\infty}A_{s,k,N}(q)
=
\prod_p\left(\sum_{j=0}^{\infty}A_{s,k,N}(p^j)\right).
\end{align*}
Using the local identity already proved,
\begin{align*}
\sum_{j=0}^{\infty}A_{s,k,N}(p^j)=\sigma_p(N),
\end{align*}
we obtain
\begin{align*}
\mathfrak S_{s,k}(N)=\prod_p\sigma_p(N).
\end{align*}
This is the desired Euler product and local density formula.
[/step]