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.)
re(2): Solutions | Comment 4 of 16 |
(In reply to re: Solutions by Charlie)

The agreement of the two ways is shown by this UBASIC:

?1000000000*(1-.9^9)+1
 612579512.0000000002190879977
OK


10 for i=0 to 8
20  t=t+100000000*.9^i
30 next
40 ?t+1
run
 612579511.9999999998992483568
OK

Internal rounding results in those differences from integer.


  Posted by Charlie on 2004-07-26 10:54:50
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 (3)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

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