How to solve this

Can someone explain how to solve this problem

So, note that how the numbers are formed.

5

25

5 + 25

125

5 + 125

25 + 125

5 + 25 + 125

Wait, do you see something?
First of all convert the number in binary.

For eg. take n = 9

In binary:

  625  125  25   5

  1    0    0    1

The numbers in the upper row are powers of 5. So, the answer is the sum of binary digit multiplied by respective power of 5.
Which is 630 in this case. Hope this helped. :slight_smile:

1 Like

Great @dhruvsomani very nice explanation