All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Numbers
How many 1s? (Posted on 2004-07-26) Difficulty: 2 of 5
If I took all the numbers from one to one billion:
  1. How many of them contain at least one '1'?
  2. If I wrote them out in one long line, how many 1 digits would there be?

See The Solution Submitted by Thalamus    
Rating: 3.0000 (12 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution Wrong answer | Comment 9 of 16 |

That program took about 15 minutes to run.  :)

Well, I couldnt sleep last night because I knew my answer for part 2 was wrong.  I am sticking with my answer to part 1 because computer programs dont lie (if the program is written right that is)

Part 2:
From 0-999, there are 300 "1"s, and from 0-1 Billion, there are one million sets of (0-999) for each of the 3 groupings:

1,(GROUP1),(GROUP2),(GROUP3)

So, my next stab at part 2 is:  3*300*1,000,000 + 1 (for 1 billion) or 900,000,001


  Posted by Dustin Smith on 2004-07-31 08:29:43
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (23)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information