First all the even number dies then left with the odd number only. Then the passing goes on within the odd number in sequence from smaller to larger until one people stands, that is number 73 is the winner.

The solution requires getting the nearest numbers that is the power of 2 which is smaller than total number of soldiers, in this case 64 and subtract it with the given number.

100-64=36.

Now we apply the formula;2n+1 = 2*36 + 1 = 72 + 1 = 73.

CODE--

SELECT (2*(100 - MS) + 1) AS R

FROM (SELECT MAX(t) MS

FROM (SELECT rownum,

(POWER(rownum,2)) AS t,

MOD(rownum,2) AS M

FROM (SELECT 1 FROM dual GROUP BY CUBE(1,2,3,4,5,6,7))

WHERE rownum <= 100)

WHERE M = 0

AND t < 100);

MS --max of squre

M-- Dividend is stored as M

15,616,780 members