an interesting problem
|
05-03-2015, 03:10 AM
Post: #12
|
|||
|
|||
RE: an interesting problem
There can't be an even digit (or zero) since putting that digit in the final position results in a composite number. Likewise, we can't have a five. That leaves: 1, 3, 7 & 9 as possible digits.
Since we're not allowed repeated digits we have to check: Code: 137 For each of these four we need to check all digit permutations: Code: 137 So twenty four possibilities here. However by judiciously choosing composite numbers first, we can do it in with four tries Code: 371 More realistically, by starting at the top of each list of six and stopping when we find a composite, we have to make fifteen primality checks. - Pauli |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 2 Guest(s)