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 A376213 #19 Sep 30 2024 12:44:24 %S A376213 113,131,197,199,311,337,373,719,733,919,971,991,1013,1019,1031,1091, %T A376213 1123,1163,1181,1193,1213,1231,1237,1279,1297,1307,1319,1321,1327, %U A376213 1399,1439,1487,1499,1543,1549,1571,1613,1621,1637,1733,1747,1759,1777,1811,1831,1913 %N A376213 Prime numbers wherein a triple exchange of 3 of the digits creates two prime numbers, neither of which has a leading zero digit. %C A376213 A triple exchange is a permutation of 3 elements in which all 3 three items change position. (For the triple "ABC", that would be "BCA" and "CAB".) %e A376213 The first term is the prime 113, since 131 and 311 are also prime. Another term is 1013, since 1103 and 1301 are prime. %o A376213 (Python) %o A376213 from sympy import isprime %o A376213 from itertools import combinations, permutations %o A376213 def ok(n): %o A376213 if n < 100 or not isprime(n): return False %o A376213 s = list(str(n)) %o A376213 for i, j, k in combinations(range(len(s)), 3): %o A376213 pset, w, x = {n}, s[:], s[:] %o A376213 w[i], w[j], w[k] = w[j], w[k], w[i] %o A376213 x[i], x[j], x[k] = x[k], x[i], x[j] %o A376213 if w[0] != "0" and isprime(t:=int("".join(w))): pset.add(t) %o A376213 if x[0] != "0" and isprime(t:=int("".join(x))): pset.add(t) %o A376213 if len(pset) == 3: return True %o A376213 return False %o A376213 print([k for k in range(1920) if ok(k)]) # _Michael S. Branicky_, Sep 17 2024 %Y A376213 Subsequence of A225035. Cf. A375965. %K A376213 nonn,base %O A376213 1,1 %A A376213 _James S. DeArmon_, Sep 15 2024 %E A376213 Terms corrected by _Michael S. Branicky_, Sep 17 2024