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.
Original entry on oeis.org
3, 13, 103, 1117, 11119, 114031, 1114693, 11213611, 101116111, 1013251111, 10116171733, 101346411811, 1011670114111, 11111117116117
Offset: 1
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.
-
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]
A228150
a(n) is the smallest n-digit prime which remains prime whenever a 9 is inserted, appended or prepended, or 0 if no such prime exists.
Original entry on oeis.org
7, 19, 199, 1009, 19417, 160009, 1086791, 10301299, 139993999, 1391909989, 10597399381, 108979916999, 1993999651909, 13924969999799
Offset: 1
a(4) = 1009 is the smallest 4-digit prime which yields 5 primes by inserting a 9 in every possible position: 91009, 19009, 10909, 10099, 10099.
-
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, 9], Throw@p, p = NextPrime@p]]; 0]]; a /@ Range[8]
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.
Original entry on oeis.org
3, 19, 433, 1471, 13177, 175687, 1740787, 10871017, 137725897, 1670181787, 12845952529, 117777772309, 1008078796477, 11777787780727
Offset: 1
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.
-
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]
A164327
a(n) is the smallest n-digit term of A158594 and zero if there is no such number.
Original entry on oeis.org
1, 11, 121, 1033, 10423, 131329, 1039843, 11939237, 103333333, 1137333347, 10300335833, 101393333923, 1023239337799
Offset: 1
Showing 1-4 of 4 results.
Comments