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

Home > Just Math
Mas o menos vs comme il faut (Posted on 2021-12-04) Difficulty: 3 of 5
How many natural numbers exist in the range 142858 to 999999 inclusive, such that :
a. None of them is a multiple of 5.
b. The digit 3 is not contained in the number

D1 Please provide your estimate solution (p & p)
D3. Evaluate the exact result.

No Solution Yet Submitted by Ady TZIDON    
Rating: 4.0000 (1 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution estimated and calculated | Comment 1 of 3
Estimate:   347733
Calculated: 350499 

For the estimate, consider each of the 6 digits in turn, starting with the last.
The last digit can have 7 values:  not 0, 3 or 5.
The second through fifth digits can take 9 values:  anything but 3.
The first digit can either be a 1, which is a special case, or can take 7 other values: 2,4,5,6,7,8,9.

So last 5 digits can occur in 9*9*9*9*7 ways
Multiply that by a 7 to get the solution if the problem had started with 200000.
But about 3/7 of the 6 digit numbers starting with a 1 are not part of our problem, so we need to add about 4/7 of 9*9*9*9*7 to account for range(142858, 200000)

Estimate:  
= (7+4/7)*9*9*9*9*7 
= (53/7)*9*9*9*9*7
= 53*9*9*9*9   =  347733
(which is off by 2766)

==== Python code ====
count = 0
for i in range(142858, 1000000):
    if i%5 == 0:
        continue
    if '3' in str(i):
        continue
    count += 1
estimate = 53*9*9*9*9
print(count, estimate)

Edited on December 4, 2021, 8:55 am
  Posted by Larry on 2021-12-04 08:54:53

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 (5)
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