Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

2010 and sum of digits puzzle

  1. Jan 16, 2010 #1
    Determine the sum of all the digits in the positive integers from 1 to 2010 inclusively.
     
  2. jcsd
  3. Jan 16, 2010 #2

    Char. Limit

    User Avatar
    Gold Member

    42.

    It's the answer to everything.
     
  4. Jan 16, 2010 #3

    cronxeh

    User Avatar
    Gold Member

    2010*(2010+1)/2
     
  5. Jan 16, 2010 #4

    Char. Limit

    User Avatar
    Gold Member

    Wouldn't that get you the sum of all the numbers, not the sum of the digits?
     
  6. Jan 16, 2010 #5

    cronxeh

    User Avatar
    Gold Member

    0->9 : (0..9) = 45
    10->19 : 10*1*(0..9) = 450
    20->29 : 10*2*(0..9) = 900
    30->39: 10*3*(0..9) = 1350
    ....
    2000-2009 : 10*200*(0..9) = 90000

    + 1
    ....


    10*(1..200) + 201*(0..9) + 1 = 201000 + 9045 + 1 = 210046 digits from 1 to 2010
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: 2010 and sum of digits puzzle
Loading...