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.

A341017 Primes p such that placing digit i at both ends of p produces another prime for at least two of i = [1,3,7, 9].

This page as a plain text file.
%I A341017 #9 Feb 02 2021 19:48:49
%S A341017 2,5,17,23,29,31,41,43,47,53,61,67,71,73,83,101,107,113,131,149,197,
%T A341017 239,241,257,263,269,293,317,347,359,389,401,421,431,443,503,521,557,
%U A341017 593,599,607,641,647,677,683,701,757,797,827,887,911,953,1031,1103,1109,1117,1171,1181,1187,1223,1277
%N A341017 Primes p such that placing digit i at both ends of p produces another prime for at least two of i = [1,3,7, 9].
%C A341017 Numbers that are in at least two of A069687, A069688, A069689 and A069690.
%H A341017 Robert Israel, <a href="/A341017/b341017.txt">Table of n, a(n) for n = 1..10000</a>
%e A341017 a(3) = 17 is a term because 17 is in A069687 and A069689, i.e. 1171 and 7177 are prime.
%p A341017 filter:= proc(n) local i; isprime(n) and numboccur(true,[seq(isprime(i+10*n+i*10^(2+ilog10(n))),i=[1,3,7,9])]) >= 2 end proc:
%p A341017 select(filter, [2,seq(i,i=3..1000)]);
%o A341017 (Python)
%o A341017 from sympy import isprime, nextprime
%o A341017 def ok(p): return sum(isprime(int(c+str(p)+c)) for c in "1379") >= 2
%o A341017 def aupto(limit): # only test primes
%o A341017   alst, p = [], 2
%o A341017   while p <= limit:
%o A341017     if ok(p): alst.append(p)
%o A341017     p = nextprime(p)
%o A341017   return alst
%o A341017 print(aupto(1277)) #_Michael S. Branicky_, Feb 02 2021
%Y A341017 Cf. A069687, A069688, A069689, A069690.
%K A341017 nonn,base
%O A341017 1,1
%A A341017 _J. M. Bergot_ and _Robert Israel_, Feb 02 2021