A246044 Monoprimatic permutable primes: Decimal prime numbers whose digits cannot be rearranged to form another prime number. No leading zeros allowed.
2, 3, 5, 7, 11, 19, 23, 29, 41, 43, 47, 53, 59, 61, 67, 83, 89, 101, 103, 109, 151, 211, 223, 227, 229, 233, 257, 263, 269, 307, 353, 383, 401, 409, 431, 433, 443, 449, 487, 499, 503, 509, 523, 541, 557, 599, 601, 607, 661, 677, 773, 809, 827, 829, 853, 859, 881, 883, 887, 929, 997, 1447, 1451, 1481, 2003, 2017, 2029, 2087
Offset: 1
Examples
859 -> 589 (composite), 598 (even), 859 (prime), 895 (composite), 958 (even), 985 (composite) -> conclusion: one prime number.
Links
- Giovanni Resta, Table of n, a(n) for n = 1..760 (terms < 10^13, terms 1..406 from Andreas Boe, terms 407..538 from Chai Wah Wu)
Crossrefs
Programs
-
Mathematica
mppQ[n_]:=Total[Boole[PrimeQ[Select[FromDigits/@Permutations[IntegerDigits[n]],IntegerLength[ #] == IntegerLength[ n]&]]]] ==1; Select[Prime[Range[500]],mppQ] (* Harvey P. Dale, Dec 06 2021 *)
-
Python
from itertools import permutations from sympy import prime, isprime A246044 = [] for n in range(1,10**6): p = prime(n) for x in permutations(str(p)): if x[0] != '0': p2 = int(''.join(x)) if p2 != p and isprime(p2): break else: A246044.append(p) # Chai Wah Wu, Aug 27 2014