login
Numbers that yield a prime whenever a '1' is inserted between any two digits.
3

%I #27 Sep 08 2022 08:46:21

%S 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,

%T 117,123,151,163,181,193,211,213,231,241,279,309,319,363,367,391,411,

%U 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

%N Numbers that yield a prime whenever a '1' is inserted between any two digits.

%C The single-digit terms voidly satisfy the condition: no '1' can be inserted anywhere, so all possible insertions yield a prime.

%C Motivated by sequence A164329 which is the analog for inserting 0.

%C Compare to A068673 where 1 is prefixed or appended, and to A068679 where 1 is prefixed, appended or inserted anywhere - which is therefore the intersection between this sequence and A068673.

%C See also A050711 where 1 is inserted between all adjacent digits. - _R. J. Mathar_, Feb 28 2020

%e 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.

%e 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.

%p filter:= proc(n) local j,t;

%p for j from 1 to ilog10(n) do

%p if not isprime(10*n-9*(n mod 10^j)+10^j) then return false fi

%p od;

%p true

%p end proc:

%p select(filter, [$0..1000]); # _Robert Israel_, Jun 01 2018

%o (PARI) is(n)=!for(k=1,logint(n+!n,10),isprime(10*n-n%10^k*9+10^k)||return)

%o (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

%Y 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).

%Y Cf. A068679 (1 is prefixed, appended or inserted anywhere), A069246 (primes among these), A068673 (1 is prefixed, or appended).

%Y Cf. A158594 (3 is prefixed, appended or inserted anywhere), A215419 (primes among these).

%Y Cf. A069832 (7 is prefixed, appended or inserted anywhere), A215420 (primes among these), A068677 (7 is prefixed or appended).

%Y Cf. A069833 (9 is prefixed, appended or inserted anywhere), A215421 (primes among these).

%Y Cf. A158232 (13 is prefixed or appended).

%Y Cf. A304243 (2 is prefixed or prime(k+2) is inserted after the k-th digit), A304244 (prime(k) is inserted after the k-th digit), A304245 (prime(k+1) is inserted after the k-th digit, k > 1, or '2' after the first digit).

%K nonn,base

%O 1,3

%A _M. F. Hasler_, Jun 01 2018