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
outputs2
and so forth) or 1-based indexing (such that1
outputs2
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 code-golf; fewest bytes wins.
- Standard loopholes apply.