Infosys
Company
A jail has 100 cells, numbered 1 to 100. The king Declares some sort of amnesty and orders the following.
step 1: make sure all Cells are closed
step2: reverse (if open, close; if close, open) those Cells whose numbers are divisible by 1 (in this step, all cells will be Opened);
step 3: reverse those that are divisible by 2 (in this step, All even numbered cells will be closed);
step 4: reverse those that are Divisible by 3;
step 5: reverse those divisible by 4;
step 6 to step 101: and so on . . .
step 102: release the prisoners in those cells which are finally Open. How many prisoners will be released, and from which cells?
Read Solution (Total 1)
-
- the numbers with odd number of factors will get opened. For example, number 2 has 2 factors -1,2 while number 4 has 3 factors-1,2,4. The numbers with odd factors gets opened up finalyy.
hence all the perfect square numbers under 100 gets opened
1,4,9,16,25,36,49,64,81,100
Ans: 10 - 4 years agoHelpfull: Yes(0) No(0)
Infosys Other Question