By setting n=1, we obtain mf(1)=0 for all m, so f(1)=0. Next we notice that since every positive integer can be written as a product of prime numbers, the function f is determined completely by its value on the primes. If there exists m≥2 such that f(m)=0, then f(m)=f(1) and we are done. Thus assume for all m≥2 that f(m)≥1.
Thus
f(2024)=f(8⋅11⋅23)=23f(8⋅11)+88f(23)=23(11f(8)+8f(11))+88f(23)=253f(8)+184f(11)+88f(23).
To study f(8), we instead derive a general formula for perfect powers:
f(a2)=af(a)+af(a)=2af(a),
f(a3)=a2f(a)+af(a2)=3a2f(a).
We assume as inductive hypothesis that
f(an)=nan−1f(a),
and prove it for n+1 by
f(an+1)=f(an⋅a)=af(an)+anf(a)=a(nan−1)f(a)+anf(a)=(n+1)anf(a).
Thus
10120=f(2024)=253(3⋅22)f(2)+184f(11)+88f(23)=3036f(2)+184f(11)+88f(23).(1)
Considering this equation modulo 11, we conclude that f(11) is divisible by 11, and by the assumption that f(11)≥1, we conclude that f(11)≥11. Similarly, working modulo 23 tells us that f(23) is divisible by 23 and thus f(23)≥23. Finally, working modulo 8 tells us that 4f(2) is divisible by 8, so f(2)≥2. Thus the right hand-side of (1) is greater than or equal to
3036⋅2+184⋅11+88⋅23=10120.
Since we have equality, we must conclude that
f(2)=2,f(11)=11andf(23)=23.
Our only hope to find two integers m and n for which f(m)=f(n) is to use the information just obtained. Thus, we set
m=2a11b23cn=2d11e23f.
Intuitively we hope to find values of d, e, f that are close to a, b, c (e.g. differ by 1) and then solve for values a, b, c that happen to work. We notice that 2⋅11=22 is close to 23, so let us study
f(22a23c)=23cf(22a)+22af(23c)=23c(a⋅22a−1⋅f(22))+22a(c⋅23c−1⋅f(23))=23c(a⋅22a−1⋅(2f(11)+11f(2)))+22a(c⋅23c−1⋅23)=23c(a⋅22a−1⋅44)+22a(c⋅23c−1⋅23)=(2a+c)22a23c
Now we compare f(22a23b+1) with f(22a+123b) and hope to find values of a, b for which they are equal.
f(22a23b+1)f(22a+123b)=(2a+b+1)22a23b+1,=(2(a+1)+b)22a+123b.
Thus if we can find values of a, b such that
2a+b+1=22and2a+b+2=23
we would be done. Luckily there are many such pairs, for example
(a,b)∈{(1,19),(2,17),(3,15),(4,13),(5,11),(6,9),(7,7),(8,5),(9,3),(10,1)}.