Solution to 'Sum of integers'