A304246 Numbers that yield a prime whenever a '1' is inserted between any two digits.
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 13, 21, 31, 33, 37, 49, 63, 67, 69, 79, 81, 91, 99, 103, 109, 117, 123, 151, 163, 181, 193, 211, 213, 231, 241, 279, 309, 319, 363, 367, 391, 411, 427, 429, 453, 457, 459, 501, 513, 519, 547, 571, 601, 613, 621, 631, 697, 703, 709, 721, 729, 777, 787, 801, 811, 817, 879, 903, 951, 981, 987
Offset: 1
Examples
21 is in the sequence, because if '1' is inserted between "any" pair consecutive digits (the only possibility being to insert it between the first and second digit, which yields 211), the result is always prime. The definition does not require the term itself to be prime. 103 is in the sequence because inserting 1 between the first and second, or between the second and third digit, would yield 1103 or 1013, respectively, which are both prime.
Crossrefs
Cf. A164329 (prime when 0 is inserted anywhere), A216169 (subset of composite terms), A215417 (subset of primes), A159236 (prime when 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).
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
-
Magma
[0] cat [k:k in [1..1000]| forall{i:i in [1..#Intseq(k)-1]| IsPrime(Seqint(Reverse(v[1..i] cat [1] cat v[i+1..#v]))) where v is Reverse(Intseq(k)) }]; // Marius A. Burtea, Feb 09 2020
-
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)+10^j) then return false fi od; true end proc: select(filter, [$0..1000]); # Robert Israel, Jun 01 2018
-
PARI
is(n)=!for(k=1,logint(n+!n,10),isprime(10*n-n%10^k*9+10^k)||return)
Comments