Quantcast XP Math - Forums - View Single Post - Intermediate How Many Ones?
Thread: Intermediate How Many Ones?
View Single Post
Old 04-20-2009   #4
Sugengz
 
Join Date: Mar 2009
Posts: 4
Default

Using Mathematica the answer is 600,000...

Here is the code:

For[x = 1; y = 0, x <= 999999, x++; y = y + StringCount[ToString[x], "1"]]; Print[y]
Sugengz is offline