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.

A228149 a(n) is the smallest n-digit prime which remains prime whenever a 7 is inserted, appended or prepended, or 0 if no such prime exists.

This page as a plain text file.
%I A228149 #11 Jun 13 2021 03:29:38
%S A228149 3,19,433,1471,13177,175687,1740787,10871017,137725897,1670181787,
%T A228149 12845952529,117777772309,1008078796477,11777787780727
%N A228149 a(n) is the smallest n-digit prime which remains prime whenever a 7 is inserted, appended or prepended, or 0 if no such prime exists.
%C A228149 Smallest n-digit term of A215420.
%e A228149 a(3) = 433 is the smallest 3-digit prime which yields 4 primes by inserting a 7 in every possible position: 7433, 4733, 4373, 4337.
%t A228149 pp[n_, k_] := Catch[Block[{d = IntegerDigits@n}, Do[If[! PrimeQ[ FromDigits[ Insert[d, k, i]]], Throw[False]], {i, 1+Length@d}]; True]]; a[n_] := Catch[ Block[{p = NextPrime[10^(n-1)]}, While[p < 10^n, If[pp[p, 7], Throw@p, p = NextPrime@p]]; 0]]; a /@ Range[8]
%Y A228149 Cf. A215420, A164328, A228148, A228150.
%K A228149 nonn,base,more
%O A228149 1,1
%A A228149 _Giovanni Resta_, Aug 13 2013