No need for calculating individual magic(x), just count the number of
ordered list L with max(L)=11.
Partition those ordered list by its gcd, and check each part, then you
can see the trick.
On 2011-1-13 11:06, Pratik Bhadkoliya wrote:
For example,
for 1: divisor is only 1 so,
For example,
for 1: divisor is only 1 so,
answer is magic(1) = 1 [since (1,1,1,1,1,...,1,1) is the only list
possible.]
for 2: divisors are 1 and 2
answer is [magic(1) + magic(2)] % 10^8
for 3:
answer is [magic(1) + magic(3)] % 10^8
for 4:
answer is [magic(1) + magic(2) + magic(4)] % 10^8
by o