This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A359136 #27 Jan 23 2023 12:07:14 %S A359136 11,13,17,31,37,71,73,79,97,101,103,107,109,113,127,131,137,139,149, %T A359136 151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239, %U A359136 241,251,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,419,421 %N A359136 Primes such that there is a nontrivial permutation which when applied to the digits produces a prime (Version 1). %C A359136 A prime p with decimal expansion p = d_1 d_2 ... d_m is in this sequence iff there is a non-identity permutation pi in S_m such that q = d_pi(1) d_pi(2) ... d_pi(m) is also a prime. The prime q may or may not be equal to p. Leading zeros are permitted in q. %C A359136 One must be careful when using the phrase "nontrivial permutation of the digits". When the first and third digits of 101 are exchanged, this is applying the nontrivial permutation (1,3) in S_3 to the digits, leaving the number itself unchanged. One should specify whether it is the permutation that is nontrivial, or its action on what is being permuted. In this sequence and A359137, we mean that the permutation itself is nontrivial. %C A359136 There are only 34 primes not in this sequence, the greatest of which is 5849. - _Andrew Howroyd_, Jan 22 2023 %H A359136 Andrew Howroyd, <a href="/A359136/b359136.txt">Table of n, a(n) for n = 1..1000</a> %o A359136 (PARI) isok(n)={my(v=vecsort(digits(n))); if(#Set(v)<#v, 1, forperm(v, u, my(t=fromdigits(Vec(u))); if(isprime(t) && t<>n, return(1))); 0)} \\ _Andrew Howroyd_, Jan 22 2023 %o A359136 (Python) %o A359136 from sympy import isprime %o A359136 from itertools import permutations as P %o A359136 def ok(n): %o A359136 if not isprime(n): return False %o A359136 if len(s:=str(n)) > len(set(s)): return True %o A359136 return any(isprime(t) for t in (int("".join(p)) for p in P(s)) if t!=n) %o A359136 print([k for k in range(422) if ok(k)]) # _Michael S. Branicky_, Jan 23 2023 %Y A359136 Many OEIS entries are subsequences (possibly after omitting 2, 3, 5, and 7): A007500, A055387, A061461, A069706, A090933, A225035. %Y A359136 Cf. A359137, A359138, A359139. %K A359136 nonn,base %O A359136 1,1 %A A359136 _N. J. A. Sloane_ and _Allan C. Wechsler_, Jan 22 2023 %E A359136 More than the usual number of terms are shown in order to distinguish this from neighboring sequences. %E A359136 Incorrect terms removed by _Andrew Howroyd_, Jan 22 2023