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

Home > Numbers
Maybe prime (Posted on 2024-12-09) Difficulty: 2 of 5
A positive integer is called "maybe prime" if all of its digits are primes and the number is not divisible by 2 or 3. Find the number of positive integers less than 10000 that are "maybe prime".

No Solution Yet Submitted by Danish Ahmed Khan    
No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution Analytic Solution Comment 2 of 2 |
Seriously, GET RID OF THE COMPUTER PROGRAM!!!!!!  This is only difficulty 2!

The valid digits are 2, 3, 5 and 7.
2 cannot be the last digit because the number needs to be odd.

Also exactly two of 3, 5 or 7 can be the last digit since they represent the three different congruency classes mod 3 and we need the last digit to not create a multiple of 3.  Example, if we have 235X then the last digit X can be either 3 or 7; it cannot be 5 since 2355 is a multiple of 3.

So then for a number of d digits there are 2*4^(d-1) = 2^(2d-1) possible "maybe primes".
Less than 10000 means we look at d=1 through 4.  2^1 + 2^3 + 2^5 + 2^7 = 2 + 8 + 32 + 128 = 170 "maybe primes" under 10000.

  Posted by Brian Smith on 2024-12-10 11:29:41
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 - 2025 by Animus Pactum Consulting. All rights reserved. Privacy Information