12517

Theory:

from 0 to 99 there are 2*10^1=20 for each 0 to 9 digits.
from 0 to 999 there are 3*10^2=300 for each 0 to 9 digits.
so the foemulae is for 0 to n number of 9’s n*10^(n-1) for each 0 to 9 digits.
And so, for upto 445 we can find total number of digits by splitting 445=400+40+5
upto 0 to 400 total number of digits=4*(2*10^1)=80 0 to 9 each and and plus there will 100 of 1 upto 3 each.
so total sum of all the digits 0 upto 400 = 80 + 80*2 + 80*3 + 80*4 +…+80*9 + (1*100 + 2*100 + 3*100) + 4(single most significant digit)=4204
same way 0 to 40 total sum = 4 + 4*2 + 4*3 + ….+ 4*9 + (1*10 + 2*10 + 3*10) + 4 = 244
so from 401 upto 440 there will be additional 40 4’s will be added so 244+40*4=244+160=404
and for 0 to 5 total sum = 0 + (1*1 + 2*1 + 3*1 + 4*1)+5 = 15
so from 441 upto 445 there will be additional (5*2)=10 4’s will be added so 15+40=55

so total sum of digits = 4204+404+25 = 4663

Solution:

 

Leave a Reply

Your email address will not be published. Required fields are marked *