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.

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

This page as a plain text file.
%I A304246 #27 Sep 08 2022 08:46:21
%S A304246 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 A304246 117,123,151,163,181,193,211,213,231,241,279,309,319,363,367,391,411,
%U A304246 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 A304246 Numbers that yield a prime whenever a '1' is inserted between any two digits.
%C A304246 The single-digit terms voidly satisfy the condition: no '1' can be inserted anywhere, so all possible insertions yield a prime.
%C A304246 Motivated by sequence A164329 which is the analog for inserting 0.
%C A304246 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 A304246 See also A050711 where 1 is inserted between all adjacent digits. - _R. J. Mathar_, Feb 28 2020
%e A304246 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 A304246 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 A304246 filter:= proc(n) local j,t;
%p A304246   for j from 1 to ilog10(n) do
%p A304246     if not isprime(10*n-9*(n mod 10^j)+10^j) then return false fi
%p A304246   od;
%p A304246   true
%p A304246 end proc:
%p A304246 select(filter, [$0..1000]); # _Robert Israel_, Jun 01 2018
%o A304246 (PARI) is(n)=!for(k=1,logint(n+!n,10),isprime(10*n-n%10^k*9+10^k)||return)
%o A304246 (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 A304246 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 A304246 Cf. A068679 (1 is prefixed, appended or inserted anywhere), A069246 (primes among these), A068673 (1 is prefixed, or appended).
%Y A304246 Cf. A158594 (3 is prefixed, appended or inserted anywhere), A215419 (primes among these).
%Y A304246 Cf. A069832 (7 is prefixed, appended or inserted anywhere), A215420 (primes among these), A068677 (7 is prefixed or appended).
%Y A304246 Cf. A069833 (9 is prefixed, appended or inserted anywhere), A215421 (primes among these).
%Y A304246 Cf. A158232 (13 is prefixed or appended).
%Y A304246 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 A304246 nonn,base
%O A304246 1,3
%A A304246 _M. F. Hasler_, Jun 01 2018