I (seriously) doubt whether this βoppositeβ approach will be faster than the @izomorphius suggestion, but may give rise to some thoughts about improving the performance of your program:
1) Get a list of primes in the range 2..71 (you can omit 1 and 72 for any reason, since none is prime).
2) List the whole sections of each of the prime numbers in the list. Here is some Python code . You want to change this so as not to generate invalid partitions, such as numbers with numbers greater than 9.
3) For each of these sections, lay out with 0s to make a set of 8 digits, then list all the permutations of the filled set.
Now you have a list of the numbers you need.
source share