Three students play a game. At the end of each turn, the loser must double the amount of money that the other two players have. After three turns, each student has lost once and they all have $24. How much did each student have to begin with?

More generally, if *n* students play the same game and after *n*
turns, each student has lost once and they all end up with the same amount
of money (say *A*), how much did each student have to begin with (in
terms of *n* and *A*)?