# Euler product of Dirichlet series

Let $f$ be an arithmetic function such $f(n_1n_2)=f(n_1)f(n_2)$ for all $n_1,n_2 \in \mathbb{N}$ with $\gcd(n_1,n_2)=1$. Suppose we know that the Dirichlet series $$F(s) = \sum_{n=1}^{\infty}f (n)n^{−s}$$ has an Euler product of the form $$F(s)=\prod_{p \text{ prime}}\left(1+\sum_{n=1}^\infty f(p^n)p^{-ns}\right).$$ Let $N\in \mathbb{N}$. Set $$F(s,N) = \sum_{\substack{n=1\\\gcd(n,N)=1}}^{\infty}f (n)n^{−s}.$$ I would like to show that $$F(s,N)=\prod_{\substack{p\text{ prime}\\\gcd(p,N)=1}}\left(1+\sum_{n=1}^\infty f(p^n)p^{-ns}\right)$$ How does one do this?

This is just the fundamental theorem of arithmetic. Let $f(n)n^{-s}$ be a summand in $F(s,N)$, then the term is equal to
$$\prod_{p|n}f(p^{n_p})p^{-s}$$
where $n_p$ is the exact power to which $p|n$. But then the Euler product has exactly those terms in it and no others, so by convergence on the appropriate half-plane the two functions are equal where they are defined.