login
A304248
Numbers that yield a prime whenever a '3' is inserted between any two digits.
2
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 17, 19, 23, 29, 31, 37, 41, 43, 49, 61, 73, 79, 89, 97, 101, 103, 121, 127, 167, 173, 181, 209, 211, 233, 239, 247, 251, 271, 283, 299, 307, 331, 343, 359, 361, 373, 391, 437, 439, 473, 491, 497, 509, 523, 533, 547, 551, 599
OFFSET
1,3
COMMENTS
Motivated by existing sequences defined in a similar way for other digits (e.g., A164329 for digit 0), subsequence A158594 = intersection of this and A068674 ('3' is prefixed or appended), and others: cf. cross-references.
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. A069833 (9 is prefixed, appended or inserted anywhere), A215421 (primes among these).
Cf. A158232 (13 is prefixed or appended).
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).
Sequence in context: A143288 A001103 A265730 * A147591 A271954 A330969
KEYWORD
nonn,base
AUTHOR
M. F. Hasler, Jun 01 2018
STATUS
approved