We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
3, 6, 9, 12 .... geometric series. so sum = a(r^n - 1)/(r-1) with a= 3 r = 2 and sum = t (given time). from this equation i get 2^n = (t + 3)/3 and i get n = log2 (t+3/3) and n is cycle. in which cycle t belongs. now start is my current cycle start number. now how long i will decrease my start. that's i get from rem variable which is t - previous cycle last time.
it's simply a concept of geometric sereis
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Strange Counter
You are viewing a single comment's thread. Return to all comments →
3, 6, 9, 12 .... geometric series. so sum = a(r^n - 1)/(r-1) with a= 3 r = 2 and sum = t (given time). from this equation i get 2^n = (t + 3)/3 and i get n = log2 (t+3/3) and n is cycle. in which cycle t belongs. now start is my current cycle start number. now how long i will decrease my start. that's i get from rem variable which is t - previous cycle last time.
it's simply a concept of geometric sereis