There are rooms numbered from 1 to 99 in an apartment.
A mathematician notices that the sum of all room numbers before his room is equal to the sum of all room numbers after his room.
Find his room number.
Show Hint
This type of problem can be solved quickly with an alternative setup.
Let (S_{before} = S_{after} = K).
The total sum is (S_N = S_{before} + x + S_{after} = K + x + K = 2K + x).
Substituting (K = S_{x-1}), we get (S_N = 2S_{x-1} + x).
[ frac{N(N+1)}{2} = 2 frac{(x-1)x}{2} + x = x^2 - x + x = x^2 ]
This gives the relation (x^2 = frac{N(N+1)}{2}). For an integer solution for (x), (frac{N(N+1)}{2}) must be a perfect square. For (N=49), (frac{49 times 50}{2} = 1225 = 35^2). This confirms (x=35).