Tobby_And_Friends's blog

By Tobby_And_Friends, history, 8 years ago, In English

Problem Link: https://uva.onlinejudge.org/external/125/12546.pdf

I understand that LCM is a multiplicative function. So, for the case where n = 6, it should be like f(6) = f(2) * f(3), f(2) = (1 + 2) + (2 + 2) = 7, f(3) = (1 + 3) + (3 + 3) = 10, therefore f(6) = f(2) * f(3) = 7 * 10 = 70. But this is the wrong answer. Someone please help me out to figure out the right solution. Any help is really appreciated.

»
8 years ago, # |
Rev. 2   Vote: I like it +4 Vote: I do not like it

You should notice that f is not multiplicative, as f(1) = (1 + 1) = 2, so if it was multiplicative, f(k) = f(k) * f(1) = 2f(k) (Contradiction!). Therefore, that is not the approach.

For solving the problem, I'm thinking the following fact should be useful: Let's remember that if we enumerate prime numbers p1 = 2, p2 = 3, ..., a = p1α1p2α2..., and b = p1β1p2β2...,then LCM(a, b) = p1max1, β1)p2max2, β2).... From here, we can draw an important observation: if LCM(a, b) = n, and the maximum power of pi that divides n is ζi, then either the power of pi in a is ζi or the power of pi in b is ζi (or both). As the number of distinct prime factors is at most 15, there will be no more than 215 ways of assigning the ζi to each member of the pair. Then, you can calculate the sums more or less easily.