If we have to use all available digits once, We can form 9 prime numbers from (2,5,6,7,8), they are :


With the same rule, find another 5 digits, which have the most numbers of prime numbers. Then list all the prime numbers.


closed as off-topic by Alconja, JMP, IAmInPLS, user58, Beastly Gerbil Dec 21 '16 at 10:49

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question is off-topic as it appears to be a mathematics problem, as opposed to a mathematical puzzle. For more info, see "Are math-textbook-style problems on topic?" on meta." – Alconja, JMP, IAmInPLS, user58, Beastly Gerbil
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    $\begingroup$ Why is this number theory when this is purely a programming task? Unless there is some dark magic that allows someone to figure out if a number is prime given such conditions, which I sincerely doubt. $\endgroup$ – greenturtle3141 Dec 21 '16 at 4:40
  • $\begingroup$ What's wrong with a programming task? Some of us programmers are bored and need something interesting to do... :) $\endgroup$ – wildBillMunson Dec 21 '16 at 4:43
  • $\begingroup$ @greenturtle3141 : Ok I have deleted the number theory tag. $\endgroup$ – Jamal Senjaya Dec 21 '16 at 4:43
  • $\begingroup$ @wildBillMunson I just don't see the puzzle. Here's a puzzle: How many pairs of cousin primes are there under 1,000,000? $\endgroup$ – greenturtle3141 Dec 21 '16 at 4:50
  • $\begingroup$ I mean, y'all been complainin' and murderin questions and sayin they be no "AHA!" moment. Where be the "AHA!" here, then? I too can totally post programmin questions, that ain't got nothin on Project Euler 100+ stuff. But here tho? We just be taking every possible combo of 5 digits, and seeing if by mashin them we get the most possible number of primes. It's all a game of Where's the Biggest Waldo with numbers, except we tell a computer to do it. And I don't even think this is the first game of Hide n'Program Seek on PSE. Lo siento, but I got opinions and I don't believe this is a puzzle. $\endgroup$ – greenturtle3141 Dec 21 '16 at 5:05

You can have

39 prime numbers

from the digits

{1, 3, 7, 8, 9}

They are:

{13789, 13879, 17389, 17839, 18379, 18397, 18793, 18973, 19387, 37189, 38197, 38791, 38917, 38971, 71389, 71983, 73189, 73819, 78139, 78193, 79813, 81937, 81973, 83719, 83791, 87931, 89137, 89317, 89371, 91387, 91837, 91873, 93187, 93871, 97381, 97813, 98317, 98713, 98731}.


Not the answer you're looking for? Browse other questions tagged or ask your own question.