Prove that $f(1999)=1999$

A function $f$ maps from the positive integers to the positive integers, with the following properties:
$$f(ab)=f(a)f(b)$$ where $a$ and $b$ are coprime, and
$$f(p+q)=f(p)+f(q)$$ for all prime numbers $p$ and $q$. Prove that $f(2)=2, f(3)=3$, and $f(1999)=1999$.

It is simple enough to prove that $f(2)=2$ and $f(3)=3$, but I’m struggling with $f(1999)=1999$.
I tried proving the general solution of $f(n)=n$ for all $n$ with a proof by contradiction: suppose $x$ is the smallest $x$ such that $f(x)<x$. I’m struggling find a way to show that no such $x$ exists if $x=p^m$ for $p$ a prime.

Can anyone help me finish off the $p^m$ case, or else show me another way of finding the answer? Computers and calculators are not allowed.

Solutions Collecting From Web of "Prove that $f(1999)=1999$"

2002= 1999+3, both 1999 and 3 are primes, so $f(2002)=f(1999)+f(3)$.

The prime factorization of 2002 is: 2002=2*7*11*13.


$f(2002) = f(2)f(7)f(11)f(13)$

Now $f(7) = f(5+2) = f(5)+f(2) = f(2)+f(3)+f(2) = 7$,

$f(14) = f(11)+f(3) $ but also $f(14) = f(2) f(7)=14$, therefore $f(11)=11$ (thank you @lulu for the correction).


$f(13)=f(11)+f(2) = 13$, and we have


It follows that $f(1999) = f(2002)-f(3)=1999$.

Here’s a sketch of a “proof” that $f(n) = n $ for all $n$.

Let’s prove it by strong induction on $n$, where the small cases are in various comments.

Case 1: $n$ is composite, not a prime power. Write $n = ab$ with $a, b$ coprime. Applying the first equation gives: $f(n) = f(a)f(b)$, which is $ab=n$ by induction.

Case 2: $n$ is prime (and large enough since we have base cases) then $n+3$ is composite and we can run the same argument as case 1 to that (without needing to know that $f(n)=n$) and see that $f(n+3) = n+3$. Now the second equation gives $f(n)=n$ as desired.

Edit: Case 2b: Marco Disce pointed out in the comments that I missed the case where $n$ is prime and $n+3$ is a power of $2$, in this case we can run the same argument as case $2$ but with $n+5$ instead of $n+3$ (they can’t both be powers of 2).

Now for the remaining cases I will need a small lemma, the proof of which I will leave as an exercise to the reader:

Lemma: The Goldbach conjecture holds.

Case 3: $n = 2^k$, write $n = p+q$ for odd primes $p,q$ and use the second equation.

Case 4: $n = p^k$ for some odd $p$ and $k>1$. Write $2n = q+q’$ with $q,q’$ prime and $q’ < n$. We still need to check that $f(q) = q$, but we can now apply the same argument as case 2 to see this, with the caveat that if $q’ = 3$ we should instead show that $f(q+5)=q+5$ so as to avoid needing the $n$ case.