*initially all doors are locked..now 1st warder unlocked all these doors..so, now onward if a door no. has odd number of divisors , it means after odd number of times , it will again give odd number ..so it means after odd number of times , doors will be unlocked..
For example :-
Number Divisors
1 = 1
2 = 1,2
3 = 1,3
4 = 1,2,4
5 = 1,5
6 = 1,2,3,6
7 = 1,7
8 = 1,2,4,8
9 = 1,3,9
10 = 1,2,5,10
11 = 1,11
12 = 1,2,3,4,6,12
13 = 1,13
14 = 1,2,7,14
15= 1,3,5,15
16 = 1,2,4,8,16
Now we can analyze it..