grandes-ecoles 2021 Q4a

grandes-ecoles · France · x-ens-maths2__mp Number Theory Arithmetic Functions and Multiplicative Number Theory
If $n \in \mathbb{N}^*$, we denote, for $i \in \{0,1,2,3\}$, $$r_i(n) = \operatorname{Card}\{d \in \mathbb{N} : d \equiv i [4] \text{ and } d \mid n\}$$ We set $g(n) = r_1(n) - r_3(n)$.
Show that if $m$ and $n$ are two nonzero natural integers that are coprime, we have $g(mn) = g(m)g(n)$.
If $n \in \mathbb{N}^*$, we denote, for $i \in \{0,1,2,3\}$,
$$r_i(n) = \operatorname{Card}\{d \in \mathbb{N} : d \equiv i [4] \text{ and } d \mid n\}$$
We set $g(n) = r_1(n) - r_3(n)$.

Show that if $m$ and $n$ are two nonzero natural integers that are coprime, we have $g(mn) = g(m)g(n)$.