Subfield: Number Theory


Question: Determine all functions $f$ defined on the set of all positive integers and taking non-negative integer values, satisfying the three conditions:

(i) $f(n) \neq 0$ for at least one $n$;

(ii) $f(x y)=f(x)+f(y)$ for every positive integers $x$ and $y$;

(iii) there are infinitely many positive integers $n$ such that $f(k)=f(n-k)$ for all $k<n$.

Solution:
If a number $n$ is a product of primes, $n=p_{1} p_{2} \cdot \ldots \cdot p_{k}$, then

$$
f(n)=f\left(p_{1}\right)+\ldots+f\left(p_{k}\right)
$$

in particular, $f(1)=0$ (since $f(1)=f(1)+f(1))$.

It is also clear that $f(n)=0$ implies $f(p)=0$ for all primes $p$ dividing $n$.

Let us call positive integer $n$ good if $f(k)=f(n-k)$ for $0<k<n$. If $n$ is good then each its divisor $d$ is also good; indeed, if $n=d m$ then

$$
f(k)=f(m k)-f(m)=f(n-m k)-f(m)=f(m(d-k))-f(m)=f(d-k)
$$

for $0<k<d$. Thus, good numbers are products of good primes.

It follows immediately from (i) that there exists a prime $p$ such that $f(p) \neq 0$; let $p$ be the smallest such prime. Then $f(r)=0$ for all $r<p$ (since all prime divisors of $r<p$ are less than $p)$. Now every good number $n>p$ must be divisible by $p$. Indeed, if $n=p k+r$ is a good number, $k>0,0<r<p$, then $f(p) \leqslant f(p k)=f(n-p k)=f(r)=0$, a contradiction. Since any divisor of a good number is also good, this means that if a divisor $r$ of a good number is not divisible by $p$, it is less than $p$. Thus all good numbers have the form $r \cdot p^{k}$ with $r<p$. The condition (iii) implies that $k$ can be arbitrarily large, consequently all powers of $p$ are good.

If $q \neq p$ is a prime, $p^{q-1}-1$ is divisible by $q$ and $p^{q-1}$ is good. Then $f(q) \leqslant f\left(p^{q-1}-1\right)=$ $f(1)=0$, that is, $f(q)=0$.

Now we see that $f(n)=\nu_{p}(n) \cdot c$, where $c=f(p)$. The conditions (i) and (ii) for all such functions with $c \neq 0$ are obvious; the condition (iii) holds for all $n=p^{m}$, since $\nu_{p}\left(p^{m}-k\right)=\nu_{p}(k)$ when $0<k<p^{m}$.
We use the notion of a good number from the previous solution. As above, we also denote by $\nu_{p}(n)$ the exponent of a prime $p$ in the prime decomposition of $n$.

Say that a positive integer $k$ is big if $f(k)>0$. Let $\mathcal{B}$ be the set of big primes, and let $p_{1}<p_{2}<\ldots$ list the elements of $\mathcal{B}$ (this set might be either finite or infinite). By the problem conditions, we have

$$
f(n)=\sum_{i} \nu_{p_{i}}(n) f\left(p_{i}\right)
\tag{1}
$$

thus, the big numbers are those divisible by at least one big prime.

For a positive integer $k$, define its essence $e(k)$ to be the largest product $e$ of (not necessarily different) big primes such that $e \mid k$. In other words,

$$
e(n)=\prod_{p_{i} \in \mathcal{B}} p_{i}^{\nu_{p_{i}}(n)}
$$

This yields that $k / e(k)$ is not big, so $f(k)=f(e(k))+f(k / e(k))=f(e(k))$.

Lemma. Assume that $n$ is a good number. Then $e(k)=e(n-k)$ for all $k<n$.



Proof. Arguing indirectly, choose a minimal $k$ for which the claim of the lemma is violated. Clearly, $k$ is big, as otherwise $f(k)=f(n-k)=0$ and hence $e(k)=e(n-k)=1$.

There are $t=k / e(k)$ multiples of $e(k)$ in each of the segments [1,k] and $[n-k, n-1]$. On the other hand, there are $t-1$ such multiples on $[1, k-1]$ - and, by minimality of $k$, on $[n-k+1, n-1]$ as well. This yields that $n-k$ is a multiple of $e(k)$. Therefore,

$$
f(e(k))=f(k)=f(n-k)=f(e(k))+f\left(\frac{n-k}{e(k)}\right)
$$

so the last summand vanishes, hence $\frac{n-k}{e(k)}$ has no big prime divisors, that is, $e(n-k)=e(k)$. This contradicts our choice.

Back to the problem, assume that $|\mathcal{B}| \geqslant 2$. Take any good number $n>p_{1} p_{2}$, and let $p_{1}^{\alpha}$ be the largest power of $p_{1}$ smaller than $n$, so that $n \leqslant p_{1}^{\alpha+1}<p_{1}^{\alpha} p_{2}$. By the lemma, $e\left(n-p_{1}^{\alpha}\right)=e\left(p_{1}^{\alpha}\right)=p_{1}^{\alpha}$, which yields $p_{1}^{\alpha} \mid n$. Similarly, $p_{2} \mid n$, so that $n \geqslant p_{1}^{\alpha} p_{2}$. This contradiction shows that $|\mathcal{B}| \leqslant 1$, which by (1) yields that $f$ is listed in the answer.
We have $f\left(\prod p_{i}^{\alpha_{i}}\right)=\sum \alpha_{i} f\left(p_{i}\right)$. Note that

$$
f(n-1)+f(n-2)+\ldots+\ldots f(n-k) \geqslant f(1)+\ldots+f(k)
$$

for all $k=1,2, \ldots, n-1$, since the difference LHS-RHS is just $f\left(\left(\begin{array}{c}n-1 \\ k\end{array}\right)\right)$. Assume that $f(p)>0$. If $f(k)=f(n-k)$ for all $k$, it implies that $\left(\begin{array}{c}n-1 \\ k\end{array}\right)$ is not divisible by $p$ for all $k=1,2, \ldots, n-2$. It is well known that it implies $n=a \cdot p^{s}, a<p$. If there are two primes $p, q$ such that $f(p)>0, f(q)>0$, there exist only finitely many $n$ which are equal both to $a \cdot p^{s}, a<p$, and $b \cdot q^{t}, b<q$. So there exists at most one such $p$, and therefore $f(n)=C \cdot \nu_{p}(n)$ for some constant $C$.
We call a function $f: \mathbb{N} \rightarrow \mathbb{N}_{0}$ satisfying (ii) additive. We call a pair $(f, n)$, where $f$ is an additive function and $n \in \mathbb{N}$, good, if for all $k<n$ it holds $f(k)=f(n-k)$. For an additive function $f$ and a prime number $p$ the number $\frac{f(p)}{\ln p}$ is denoted by $g(f, p)$.

Let $(f, n)$ be a good pair such that $f(p)>0$ for at least two primes less than $n$. Let $p_{0}$ be the prime with maximal $g(f, p)$ among all primes $p<n$. Let $a_{0}$ be the maximal exponent such that $p_{0}^{a_{0}}<n$. Then $f(k)<f\left(p_{0}^{a_{0}}\right)$ for all $k<p_{0}^{a_{0}}$. Indeed, if $k=p_{1}^{a_{1}} \ldots p_{m}^{a_{m}}<p_{0}^{a_{0}}$, then

$$
\begin{aligned}
f(k) & =a_{1} f\left(p_{1}\right)+\ldots+a_{m} f\left(p_{m}\right)=g\left(f, p_{1}\right) a_{1} \ln p_{1}+\ldots+g\left(f, p_{m}\right) a_{m} \ln a_{m} \\
& <g\left(f, p_{0}\right) a_{0} \ln p_{0}=f\left(p_{0}^{a_{0}}\right) .
\end{aligned}
$$

Let $n=b p_{0}^{a_{0}}+r$, where $0<r<p_{0}^{a_{0}}$. Then $f(r)=f\left(b p_{0}^{a_{0}}\right) \geqslant f\left(p_{0}^{a_{0}}\right)$. This contradiction shows that $p_{0}^{a_{0}} \mid n$. Then $n=p_{0}^{\nu_{0}(n)} n^{\prime}$, where $n^{\prime} \leqslant p_{0}$.

The functions $f_{1}(m):=f\left(p_{0}\right) \nu_{p_{0}}(m)$ and $f_{2}:=f-f_{1}$ are additive (obviously $f(m) \geqslant$ $f\left(p_{0}^{\nu_{p_{0}}(m)}\right)=f_{1}(m)$, since $p_{0}^{\nu_{p_{0}}(m)}$ divides $\left.m\right)$. For $k<n, \nu_{p}(k)=\nu_{p}(n-k)$. Hence the pair $\left(f_{2}, n\right)$ is also good. Note that $f_{2}\left(p_{0}\right)=0$.

Choose among all primes $p<n$ the prime $q_{0}$ with maximal $g\left(f_{2}, p\right)$. As above we can prove that $n=q_{0}^{\nu_{q_{0}}(n)} n^{\prime \prime}$ with $n^{\prime \prime}<q_{0}$. Since $p_{0} \neq q_{0}$, we get a contradiction. Thus $f(n)=f(p) \cdot \nu_{p}(n)$.

Final answer: The sought functions are those of the form $f(n)=c \cdot \nu_{p}(n)$, where $p$ is some prime, $c$ is a nonnegative integer, and $\nu_{p}(n)$ denotes the exponent of $p$ in the prime decomposition of $n$