The prison problem

A prison consists of 1000 cells for each of its 1000 prisoners. The warden decides to pardon a number of the prisoners by conducting the following procedure. The 1st prisoner opens all the cell doors. The 2nd prisoner closes every 2nd cell door. The 3rd prisoner changes the state of every 3rd cell door. (ie if a cell door is open then it’s closed and vice versa) The 4th prisoner changes the state of every 4th cell door. This continues with all subsequent prisoners until the 1000th prisoner. How many prisoners are set free?

Bonus. Justify the result.


The answer is 31.

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.

0 solutions

No explanations have been posted yet. Check back later!

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...