Generate and show all primes with strictly descending decimal digits.

See also
 OEIS:A052014 - Primes with distinct digits in descending order
Related

Ascending primes


import util.
 
main =>
  DP = [N : S in power_set("987654321"), S != [], N = S.to_int, prime(N)].sort,
  foreach({P,I} in zip(DP,1..DP.len))
    printf("%9d%s",P,cond(I mod 10 == 0,"\n",""))
  end,
  nl,
  println(len=DP.len).