Pandigital prime: Difference between revisions

Content added Content deleted
(Added Quackery.)
m (→‎{{header|Quackery}}: tweaked commentary)
Line 533: Line 533:
=={{header|Quackery}}==
=={{header|Quackery}}==


As per the Factor solution, only 4 and 7 digit pandigital numbers can be prime. Clearly the largest will have 7 digits. We start with the largest 7 digit pandigital number and work down until we find one that is prime. As <code>nextperm</code> generates permutations in lexicographical order the word <code>->revnum</code> subtracts each digit from 8 to give reverse lexicographical order.
As per the Factor solution, only 4 and 7 digit pandigital numbers can be prime. Clearly the largest will have 7 digits. We start with the largest 7 digit pandigital number and work down until we find one that is prime. As <code>nextperm</code> generates permutations in lexicographical order the word <code>->revnum</code> subtracts each digit from 8 to give reverse numerical order.


<code>nextperm</code> is defined at [[Permutations with some identical elements#Quackery]].
<code>nextperm</code> is defined at [[Permutations with some identical elements#Quackery]].