Multiplicative function (source code)

= Multiplicative function
{title2=$f(1)=1,\quad f(mn)=f(m)f(n)\ \text{if }\gcd(m,n)=1$}
{wiki}

= Multiplicative arithmetic function
{synonym}

An <arithmetic function> $f$ is a <multiplicative function> when $f(1)=1$ and $f(mn)=f(m)f(n)$ for all <coprime integers> $m,n>0$, meaning their <greatest common divisor> is $1$. The condition $f(1)=1$ excludes the identically zero <function>. This definition makes no assertion about a pair whose <greatest common divisor> exceeds $1$. https://darijgrinberg.gitlab.io/floor.pdf[Darij Grinberg, MIT 18.781 lecture notes, Definition 2.2.1]{ref}

For the <divisor function>, the <integer divisors> of $2$ are $1,2$, those of $3$ are $1,3$, and those of $6$ are $1,2,3,6$. Hence
$$
\tau(6)=4=\tau(2)\tau(3)=2\cdot2.
$$
Here $2$ and $3$ are <coprime integers>. In contrast, $\tau(4)=3\ne4=\tau(2)^2$, because the <integer divisors> of $4$ are $1,2,4$. Thus the <divisor function> is a <multiplicative function> but not a <completely multiplicative function>.

The practical gain is that <prime factorization> reduces all values to values at <prime powers>. For distinct <prime numbers> $p_1,\ldots,p_r$ and positive exponents $a_1,\ldots,a_r$,
$$
n=\prod_{k=1}^r p_k^{a_k}\quad\Longrightarrow\quad f(n)=\prod_{k=1}^r f(p_k^{a_k}).
$$
For instance, $f(12)=f(4)f(3)$ since $4$ and $3$ are <coprime integers>; replacing $f(4)$ by $f(2)^2$ additionally requires a <completely multiplicative function>. The short proof repeatedly applies the defining rule to <prime powers> belonging to different <prime numbers>, which are <coprime integers>.