A304247 Numbers which yield a prime whenever a '2' is inserted between any single pair of adjacent digits.
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 17, 23, 27, 29, 41, 51, 53, 77, 81, 83, 87, 89, 99, 101, 113, 123, 129, 131, 137, 149, 183, 207, 221, 243, 251, 297, 303, 321, 329, 357, 359, 399, 401, 417, 419, 429, 441, 443, 453, 461, 471, 473, 527, 533, 581, 597, 611, 621
Offset: 1
Examples
123 is in the sequence because it yields a prime when a '2' is inserted after the first or after the second digit, which yields the prime 1223 in both cases. The term itself does not need to be prime.
Links
- Chai Wah Wu, Table of n, a(n) for n = 1..10000
Crossrefs
Cf. A164329 (prime when 0 is inserted anywhere), A216169 (subset of composite terms), A215417 (subset of primes), A159236 (0 is inserted between all digits).
Cf. A068679 (1 is prefixed, appended or inserted anywhere), A069246 (primes among these), A068673 (1 is prefixed, or appended), A304246 (1 is inserted anywhere).
Cf. A069832 (7 is prefixed, appended or inserted anywhere), A215420 (primes among these), A068677 (7 is prefixed or appended).
Cf. A158232 (13 is prefixed or appended).
Programs
-
Maple
filter:= proc(n) local j,t; for j from 1 to ilog10(n) do if not isprime(10*n-9*(n mod 10^j)+2*10^j) then return false fi od; true end proc: select(filter, [$0..10000]); # Robert Israel, Jun 01 2018
-
PARI
is(n,p=2,L=logint(n+!n,10)+1,d,P)=!for(k=1,L-1,isprime((d=divrem(n,P=10^(L-k)))[2]+(10*d[1]+p)*P)||return)
Comments