The integers 1, 2, ..., 40 are written on a blackboard. The following operation is then repeated 39 times: In each repetition, any two numbers, say a and b, currently on the blackboard are erased and a new number a + b - 1 is written. What will be the number left on the board at the end?

- 821
- 820
- 819
- 781

**Answer**

Number left on the board will be the sum of numbers from 1 to 40 subtracted by 39.

S = n/2 * (a+l) = 20 * 41 = 820

Number on the board = 820 - 39 = 781

T**he correct option is D.**