No need for calculating individual magic(x), just count the number of ordered list L with max(L)=111111111111111111. 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,
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 ordered list means :
(1,1,1,1,1,....1,2) is different from (1,1,1,1,1,....,2,1)......
that is order of all integers in the list is important.

some starting values of magic function
magic(1) = 1
magic(2) = 67108862
magic(3) = 2541798719464
magic(4) = 4501057694433304
magic(5) = 1485612519757395128
magic(6) = 169091609518327614304

On Jan 12, 10:23 pm, ashish agarwal<ashish.cooldude...@gmail.com>
wrote:
didn't get your question dude

On Wed, Jan 12, 2011 at 10:39 PM, Pratik Bhadkoliya
<pkbhadkol...@gmail.com>wrote:







(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z) is an ordered
list of positive integers
Let magic(value) denote the number of such ordered lists that exist
such that gcd(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z)=1
AND max(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z)=value
Find the divisors of 111111111111111111(18 -digits) . For each of the
divisors D , compute magic(D) . Find the last 8 digits of the sum of
all the magic(D) computed .
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to
algogeeks+unsubscr...@googlegroups.com<algogeeks%2Bunsubscribe@googlegroups 
.com>
.
For more options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.

--
You received this message because you are subscribed to the Google Groups "Algorithm 
Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to