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

Home > Numbers
Primes galore (Posted on 2025-05-11) Difficulty: 3 of 5
19 is a prime number with an interesting property. If you put a 1, 3, 7, or 9 at the end, then you will get 4 more primes. 191, 193, 197, and 199 are all prime. What is the next number p>19 such that p, p1, p3, p7, p9 are all prime?

No Solution Yet Submitted by Math Man    
Rating: 5.0000 (1 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution computer solutions galore Comment 3 of 3 |
The next such after 19 is 6949:

for i=1:10000
  p=nthprime(i);
  good=true;
  for j=[1,3,7,9]
    p2=p*10+j;
    if ~isprime(p2)
      good=false;
      break
    end
  end
  if good
    disp(p)
  end
end

finds

          19
        6949
       10111
       15727
       20149
       24799
       26041
       26881
       29587
       29947
       40213
       41203
       44257
       46747
       47701
       49057
       50023
       51061
       55921
       66109
       66643
       73939
       76819
       79579
       95947

  Posted by Charlie on 2025-05-11 08:54:34
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (1)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (7)
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