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.

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

This page as a plain text file.
%I A228148 #12 Jun 13 2021 03:29:33
%S A228148 3,13,103,1117,11119,114031,1114693,11213611,101116111,1013251111,
%T A228148 10116171733,101346411811,1011670114111,11111117116117
%N A228148 a(n) is the smallest n-digit prime which remains prime whenever a 1 is inserted, appended or prepended, or 0 if no such prime exists.
%C A228148 Smallest n-digit term of A069246.
%e A228148 a(3) = 103 is the smallest 3-digit prime which yields 4 primes by inserting a 1 in every possible position: 1103, 1103, 1013, 1031.
%t A228148 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, 1], Throw@p, p = NextPrime@p]]; 0]]; a /@ Range[7]
%Y A228148 Cf. A069246, A164328, A228149, A228150.
%K A228148 nonn,base,more
%O A228148 1,1
%A A228148 _Giovanni Resta_, Aug 13 2013