Arpit
The formula that you have written is wrong. You would have approached it
correctly but the formula written here is incorrect.

m= n + (n**1/6* + (n-1)) + ((n**7/6* + (n-1))**1/6* + n-2) +......

If you add all the terms there should be 1/6 in these terms as the terms
give the number of medals given on each day.
If you use 7/6, you only need to solve for one term where n-6 would come. As
the terms in the series when 7/6 is used give the number of medals remaining
at (n-i)th day.


Sukhmeet,
You have to apply the formula
n = k - [(n-1) + (1/7)(k- (n-1))]
where k is taken to be the number of medals at the start of (n-1)th day.
on (n-1)th day, n-1 medals are given. Then (k - (n-1)) medals are left.
1/7 of these are given away as well.
So after (n-1) days  the medals left are given by RHS of the equation which
is equal to n - the medals left which are given on nth day.

Solving this equation we get:
k - (n-1) = 7/6*n

Thus, medals given away on (n-1)th day = (n-1) + (1/7)*(7/6*n) = (n-1) +
1/6*n
Similarly medals given away on (n-2)th day = (n-2) + (1/7)*(7/6*(sum of
medals given on (n-1)th and nth days))
                                                               = (n-2) +
(1/7)*(7/6*(n-1 + 7/6*n))
                                                               = (n-2) +
(1/6)*(n-1 + 1/6*n))

For  (n-i)th day,
medals given away = (n-i) + (1/6)*(sum of medals given away from (n-
(i-1))th to nth day)
It goes on like this till we get the term for first day.


SO total medals, m = n + [(n-1) + 1/6*n]  +  [(n-2) + (1/6)*(n-1 + 7/6*n))]
+...............
Put 6 in this equation and we get the required answer m = 36


Simple formula
m = n + [(n-1) + 1/6*first term]+ [(n-2) + (1/6)*(sum of 1st and 2nd term)]+
.... + [(n-i) + (1/6)*(sum of all terms till now)] + ................
i goes upto n

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

Reply via email to