Can one prove that $f(ab) = f(a) + f(b)$ can only be a linear sum of the $4$ functions

discrete mathematicsfunctionslogarithms

I was recently wondering how many functions are there take the positive integers as inputs and follows the following property:

$$ f(ab) = f(a) + f(b)$$

Here are some functions I could think of:

$$ f_1(x) = \ln(x)$$
$$ f_2(x) = 0 $$
$$ f_3(x) = \text{Number of primes of }(x)$$
$$ f_4(x) = \text{Sum of primes of }(x)$$

For example:

$$ f_3(75) = 1 + 2 =3 $$
$$ f_4(75) = 5+ 5+ 3 =13$$

with $f_3(0)= f_4(0) = 0$

Question

Is it possible to prove any function with the property: $f(ab) = f(a) + f(b)$ can only be a linear combination of the functions $f_1$, $f_2$, $f_3$ and $f_4$?

Best Answer

The positive integers $\mathbb{Z}_{>0}$ with multiplication are the free monoid on a countable set (the primes). Thus every map from this countable set to any monoid extends uniquely to a monoid homomorphism.

Your sought map is a homomorphism $\mathbb{Z}_{>0}\to\mathbb{R}$ (the codomain with addition). Indeed, $f(1)=f(1\cdot1)=f(1)+f(1)$ implies $f(1)=0$.

Thus you can define arbitrarily $f(p)=a_p$ on every prime $p$ and the function will be $$ f(p_1^{r_1}p_2^{r_2}\dotsm p_k^{r_k})=r_{p_1}a_{p_1}+r_{p_2}a_{p_2}+\dots+r_{p_k}a_{p_k} $$ Your case 1 is with $a_p=\ln p$; case 2 is $a_p=0$; case 3 is with $a_p=1$; case 4 is with $a_p=p$ (in all cases, “for every prime $p$” is implied).

You can “count the $2$’s” by setting $a_2=1$ and $a_p=0$ for every $p\ne2$. This function is not a linear combination of the ones you mention.

Related Question