SPCM - Gopu and function
Once Gopu was reading a maths problem which had a weird looking function f as follows.
1, if n is a prime number.
f(n) = f (sum of prime divisors of n) + number of distinct prime divisors of n, otherwise.
Compute f (n) for a given value of n.
First line contains T : number of test cases. (1 <= T <= 20)
For each test case, there is a single line containing integer n. (2 <= n <= 10^12).
For each test case, output value of f (n) in a single line.
Vamsi Krishna Avula:
memoization made no difference :/
@ivar try this
Note that we are counting distinct prime divisors, based on the example and also the fact that f(4) would be undefined otherwise. :pLast edit: 2014-01-14 13:53:50