Sum of integers problem

Question

Hints

Answer