MathDB
Spring 2020 Team Round Problem 5

Source:

August 22, 2020

Problem Statement

For a positive integer nn, let D(n)\mathcal{D}(n) be the value obtained by, starting from the left, alternating between adding and subtracting the digits of nn. For example, D(321)=32+1=2\mathcal{D}(321)=3-2+1=2, while D(40)=40=4\mathcal{D}(40)=4-0=4. Compute the value of the sum n=1100D(n)=D(1)+D(2)++D(100).\sum_{n=1}^{100}\mathcal{D}(n)=\mathcal{D}(1)+\mathcal{D}(2)+\dots+\mathcal{D}(100).