Our hero Batman likes to play with coins. He has number of coins all of which are white on one side and black on the other. He puts all the coins on a straight line with white side up. Now he starts to flip the coins. First he flips every coins placed at position of multiple of , then at multiple of and so on till the multiple of . He wants you to guess the last position of the coin whose black side is up if is given to be 1000000007 .
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
Answer of this question is ( ⌊ n ⌋ ) 2 . Now let me explain why.
A coin at i t h place is flipped each time when flipping is done for the multiple of divisors of i .
∵ Starting color is white and Ending color is black.
∴ No. of flipping should be odd.
Which means number of divisors of i should be odd so that coin at i t h position is black. Therefore, i is a perfect square and the last perfect square number is our solution which is ( ⌊ n ⌋ ) 2 .