First of all, that is not the formula for a sum of digits. It is the formula to calculate the sum of the first N positive integers.

Secondly, and more importantly, I can't see where you have...