English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

hi! i wrote a little code to print all primes with distinct prime digits below 100,000.
the results are 2, 3, 5, 7, 23, 37, 53, 73, 257, 523, 2357, 2753, 3257, 3527, 5237, 5273, 7253, 7523
i can't find any higher than 7523, which surprised me a little.
does anyone know if this is correct? how can i test my answers?
thanks!!

2007-12-27 01:50:29 · 3 answers · asked by Anonymous in Science & Mathematics Mathematics

3 answers

Well, note that there are only 4 distinct prime digits in the first place, so any number composed of distinct prime digits MUST have 4 or fewer digits. Indeed 7523 is the second-highest number having distinct prime digits. The only one greater is 7532, which is obviously not prime. Therefore, 7523 would have to be the largest prime number having distinct prime digits.

As other posters have already mentioned, if you remove the requirement that all of the digits be distinct, there are higher numbers available.

2007-12-27 02:28:29 · answer #1 · answered by Pascal 7 · 3 1

Sure there are more. One example is 23,327.

There's no easy way to test a number to see if it's prime. You essentially have to test for divisibility with every number that is less than the square root of the number you're testing. However, once you test a possible factor, you don't have to test its multiples. For example, if I divide 23,327 by 3 and see that its not divisible, then I don't have to test that number for 6, 9, 12, etc.

2007-12-27 02:03:35 · answer #2 · answered by McMurphyRP 3 · 0 1

7524 ... no
7526 ... no
7527 ... no
you get the cue don't you ...

2007-12-27 01:55:20 · answer #3 · answered by Anonymous · 0 3

fedest.com, questions and answers