You will escape if you have odd number of factors (1 and the number are also factors). A number has odd number of factors only if it is a perfect square. So, the prisoners in cells 1, 4, 9, 16, 25, 36, 49, 64, 81, 100 will escape. Thanks

You can find similar math puzzles at www.pratikpoddarcse.blogspot.com