CodeForces - 1097D:Makoto and a Blackboard (積性)
Makoto has a big blackboard with a positive integer n written on it. He will perform the following action exactly k
times:
Suppose the number currently written on the blackboard is v
. He will randomly pick one of the divisors of v (possibly 1 and v) and replace v with this divisor. As Makoto uses his famous random number generator (RNG) and as he always uses
as his generator seed, each divisor is guaranteed to be chosen with equal probability.
He now wonders what is the expected value of the number written on the blackboard after k
steps.
It can be shown that this value can be represented as PQ
where P and Q are coprime integers and