Solution:
Note 2s(n)=s(10n)+s(n)=s(11n), so there cannot be any carries when adding n and 10n. This is equivalent to saying no two consecutive digits of n sum to greater than 9.
We change the problem to nonnegative integers less than 104 (as both 0 and 104 satisfy the condition) so that we simply consider 4-digit numbers, possibly with leading 0s. Letting our number be abcd, we need a+b≤9, b+c≤9, and c+d≤9. Letting b′=9−b and d′=9−d, this means a≤b′, b′≥c, c≤d′.
Summing over all possible values of b′ and d′, we want
x,y=1∑10x⋅min(x,y)
The sum over pairs (x,y) with x>y is
2(1+2+⋯+10)2−(12+22+⋯+102)=2552−55⋅7=55⋅24.
The sum over pairs x≤y is
k=1∑10k2(11−k)=11⋅55⋅7−552=55⋅22
The final answer is 55⋅(24+22)=55⋅46=2530.
Solution 2:
Here is another way to calculate the sum. By doing casework on (b,c), the sum is
b+c≤9∑(10−b)(10−c)
This is the coefficient of x9 of
(n≥0∑(10−n)xn)2(n≥0∑xn)=(1−x)5(10−11x)2=(10−11x)2n≥0∑(4n+4)xn
Thus, the answer is
100(413)−220(412)+121(411)=2530