OFFSET
1,3
COMMENTS
LINKS
Chai Wah Wu, Table of n, a(n) for n = 1..10000
EXAMPLE
121 is in the sequence because it yields a prime when a digit 3 is inserted after the first or after the second digit, which yields the prime 1321 or 1231, respectively. The term itself does not need to be prime.
The single-digit numbers 0..9 are in the sequence because they satisfy the condition voidly: nothing can be inserted, so no insertion yields a nonprime, so all possible insertions always yield a prime.
MATHEMATICA
Select[Range[0, 600], AllTrue[FromDigits/@Table[Insert[IntegerDigits[#], 3, n], {n, 2, IntegerLength[ #]}], PrimeQ]&] (* Harvey P. Dale, Nov 06 2022 *)
PROG
(PARI) is(n, p=3, 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)
(Magma) [0] cat [k:k in [1..600]| forall{i:i in [1..#Intseq(k)-1]| IsPrime(Seqint(Reverse(v[1..i] cat [3] cat v[i+1..#v]))) where v is Reverse(Intseq(k))}]; // Marius A. Burtea, Feb 09 2020
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), A304246 (1 is inserted anywhere).
Cf. A304247 (2 is inserted anywhere).
Cf. A158594 (3 is prefixed, appended or inserted anywhere), A215419 (primes among these), A068674 (3 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).
KEYWORD
nonn,base
AUTHOR
M. F. Hasler, Jun 01 2018
STATUS
approved