It's a
Word Problem! I love the boolean nature of the doors - they're open, or shut, nothing in between.
Since each student will be passing through a bunch of doors, it seems you'd want to have two for loops:
one for the students
and one nested inside that, for the doors each student will interact with.
The studentNumber could just be an int, maybe. The doors have to be an int array (probably best). Then you'll need another int variable for the "multiplier" of the student number.
The first for loop will increment the studentNumber, and the inner for loop will increment the "multiplier", which I'd call 'n'.
The inner for loop will use that studenNumber * n as the index to the doors array: doors[studentNumber * n].
You'll probably want an if statement with an else attached, inside that inner for loop.
And I want to know which doors are open and which are closed, at the end.