Skip to main content
3 of 6
Rollback to Revision 1
Bob th
  • 309
  • 1
  • 3

Find the nth Prime with Distinct Prime Digits

There are 18 primes with distinct prime digits (A124674). Namely, they are:

2, 3, 5, 7, 23, 37, 53, 73, 257, 523, 2357, 2753, 3257, 3527, 5237, 5273, 7253, 7523

Given an input of n, your task is to find the nth number in the sequence.

Rules

  • You may use 0-based indexing (such that 0 outputs 2 and so forth) or 1-based indexing (such that 1 outputs 2 and so forth)
  • You may assume the input n is always valid. (with 0-based indexing, 0≤n≤17; with 1-based indexing, 1≤n≤18)
  • This is ; fewest bytes wins.
  • Standard loopholes apply.
Bob th
  • 309
  • 1
  • 3