cp's OEIS Frontend

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.

A376030 Primes which can be turned into a different prime by exchanging two digits. (Leading zeros are not allowed.)

This page as a plain text file.
%I A376030 #15 Sep 27 2024 13:42:53
%S A376030 13,17,31,37,71,73,79,97,107,113,131,137,139,149,157,163,167,173,179,
%T A376030 181,191,193,197,199,239,241,251,277,281,283,293,311,313,317,331,337,
%U A376030 347,349,359,373,379,389,397,419,421,439,457,461,463,467,491,521,547,563
%N A376030 Primes which can be turned into a different prime by exchanging two digits. (Leading zeros are not allowed.)
%H A376030 Michael S. Branicky, <a href="/A376030/b376030.txt">Table of n, a(n) for n = 1..10000</a>
%e A376030 13 is the first term, since 31 is also prime.  113 is a term, since 131 is prime. 101 is not allowed as a term: 011 is prime, but has a leading zero.
%o A376030 (Python)
%o A376030 from sympy import isprime
%o A376030 from itertools import combinations
%o A376030 def ok(n):
%o A376030     if not isprime(n): return False
%o A376030     s = list(str(n))
%o A376030     for i, j in combinations(range(len(s)), 2):
%o A376030         sij = s[:]
%o A376030         sij[i], sij[j] = sij[j], sij[i]
%o A376030         if sij[0] != "0" and sij != s and isprime(int("".join(sij))):
%o A376030             return True
%o A376030     return False
%o A376030 print([k for k in range(565) if ok(k)]) # _Michael S. Branicky_, Sep 07 2024
%Y A376030 Subsequence of A225035.
%Y A376030 Cf. A375965.
%K A376030 base,nonn
%O A376030 1,1
%A A376030 _James S. DeArmon_, Sep 06 2024
%E A376030 Corrected and more terms from _Michael S. Branicky_, Sep 07 2024