So, if the director wanted all the inmates to die, then they would just have to create a cycle of 50 numbers, starting with the number in box #1, and ending with the number in box #50, ensuring that the number 1 does not appear in that cycle, for instance:
Box 1: 2
Box 2: 3
Box 3: 4
Box 4: 5
Box 5: 6
Box 6: 7
Box 7: 8
Box 8: 9
Box 9: 10
Box 10: 11
Box 11: 12
Box 12: 13
Box 13: 14
Box 14: 15
Box 15: 16
Box 16: 17
Box 17: 18
Box 18: 19
Box 19: 20
Box 20: 21
Box 21: 22
Box 22: 23
Box 23: 24
Box 24: 25
Box 25: 26
Box 26: 27
Box 27: 28
Box 28: 29
Box 29: 30
Box 30: 31
Box 31: 32
Box 32: 33
Box 33: 34
Box 34: 35
Box 35: 36
Box 36: 37
Box 37: 38
Box 38: 39
Box 39: 40
Box 40: 41
Box 41: 42
Box 42: 43
Box 43: 44
Box 44: 45
Box 45: 46
Box 46: 47
Box 47: 48
Box 48: 49
Box 49: 50
Box 50: 51
In fact if the director put the numbers in the boxes following this pattern (the number in the box is the number of the box plus 1, and the number in box 100 is 1) then he would guarantee that the first prisoner would not find their number, even if the first prisoner was chosen at random.
Box 1: 2
Box 2: 3
Box 3: 4
Box 4: 5
Box 5: 6
Box 6: 7
Box 7: 8
Box 8: 9
Box 9: 10
Box 10: 11
Box 11: 12
Box 12: 13
Box 13: 14
Box 14: 15
Box 15: 16
Box 16: 17
Box 17: 18
Box 18: 19
Box 19: 20
Box 20: 21
Box 21: 22
Box 22: 23
Box 23: 24
Box 24: 25
Box 25: 26
Box 26: 27
Box 27: 28
Box 28: 29
Box 29: 30
Box 30: 31
Box 31: 32
Box 32: 33
Box 33: 34
Box 34: 35
Box 35: 36
Box 36: 37
Box 37: 38
Box 38: 39
Box 39: 40
Box 40: 41
Box 41: 42
Box 42: 43
Box 43: 44
Box 44: 45
Box 45: 46
Box 46: 47
Box 47: 48
Box 48: 49
Box 49: 50
Box 50: 51
In fact if the director put the numbers in the boxes following this pattern (the number in the box is the number of the box plus 1, and the number in box 100 is 1) then he would guarantee that the first prisoner would not find their number, even if the first prisoner was chosen at random.