OFFSET
1,1
COMMENTS
The primes that are obtained by the concatenation of exactly three successive composite numbers are always of the form c||c+2||c+3, with c+1 prime and c+3 odd <> 5, hence c must necessary ends with 0, 6, 8 (see examples).
No such primes can be obtained with the two other possible configurations of 3 successive composite numbers: c||c+1||c+2 or c||c+1||c+3.
The number of digits in each term is a multiple of 3. If a term existed for which this were not true, then c would necessarily be of the form 10^k - 2 (A099150), but then c+1 = 10^k - 1 would not be prime.
LINKS
Jon E. Schoenfield, Table of n, a(n) for n = 1..10000
G. L. Honaker, Jr. and Chris Caldwell, Prime Curios! 138140141.
EXAMPLE
a(1) = 138140141 because 138, 140, 141 are 3 successive composite numbers, then concat(138, 140, 141) = 138140141 is prime and is the least prime with this property (see link Prime Curios!).
The smallest such primes whose first composite ends respectively with 0, 6, 8 are: a(2) = 180182183, a(9) = 546548549, a(1) = 138140141.
If (3,q) is the smallest term formed by the concatenation of 3 successive composite numbers with each q digits: (3,3) = a(1) = 138140141, (3,4) = a(22) = 100810101011.
MATHEMATICA
nextc[n_] := Module[{k = n + 1}, While[PrimeQ[k], k++]; k]; seq = {}; n1 = 4; n2 = nextc[n1]; Do[n3 = nextc[n2]; c = FromDigits @ Flatten @ Join[IntegerDigits /@ {n1, n2, n3}]; If[PrimeQ[c], AppendTo[seq, c]]; n1 = n2; n2 = n3, {1000}]; seq (* Amiram Eldar, Mar 05 2021 *)
PROG
(PARI) lista(nn) = {my(ca=4, cb=6); forcomposite(c=7, nn, if (isprime(x=eval(concat(Str(ca), concat(Str(cb), Str(c))))), print1(x, ", ")); ca = cb; cb = c; ); } \\ Michel Marcus, Mar 05 2021
(Python)
from sympy import isprime
def aupto(limit):
c, t, alst = 6, 689, []
while t < limit:
t = int("".join(map(str, [c, c+2, c+3])))
if isprime(c+1) and not isprime(c+3) and isprime(t): alst.append(t)
c += [6, 4, 2, 2, 2][(c%10)//2]
return alst
print(aupto(109610981099)) # Michael S. Branicky, Mar 05 2021
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Bernard Schott, Mar 05 2021
STATUS
approved