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 Possible Solution | Comment 7 of 16 |

Part 1:  612,579,512

Reasoning (In Perl):

my $i=0;
for (1..1000000000)
 {
 $i++ if (/1/);
 }
print $i;

Part 2:

I am just taking a stab at this, and I am not typing the answer here because of accuracy reasons, but I believe it is:

300^1,000,000 +  300^1,000 + 1

The answer is 4955 digits long, but I cant seem to find a calculator to compute that accurately


  Posted by Dustin Smith on 2004-07-31 02:28:56
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 (13)
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