Find the number between 1 and 49 (inclusive) such that the sum to the left of it is equal to the sum to the right of it.


Note: For example, between 1 and 8, 6 would be the answer, as the sum of the numbers to the left of 6, which is $$1+2+3+4+5=15,$$ is equal to the sum of the numbers to the right of 6, which is $$7+8=15.$$

Bonus: Generalize it for any set of numbers from $$k$$ to $$n$$ with proof.

×