There are 64 people in the room.
Since the ratio for women increases 1 when 8 women enter the room, for every time there is 1 in the ratio there are 8 people. That means that originally you have to do 3x8 and 4x8. You get 24 and 32 which equals 56. Then when 8 more women enter the room, you get 64.
We have been given the sequence 2,3,5,9,17.
We can write the terms of this sequence as

From the above term we can see that for the first term we take exponent 0 on 2 and then add 1 .
For second term we take exponent 1 on 2 and then add 1 .
For third term we take exponent 2 on 2 and then add 1 .
Using this fact for the next term of the sequence i.e. 6th term, we can take exponent 5 on 2 and then add 1 .
Therefore, next term of the sequence is given by

Therefore, the next term is 33.
Using the above facts, the pattern is given by
