login
Primes formed by the concatenation of exactly two consecutive composite numbers.
1

%I #60 Mar 04 2021 03:20:22

%S 89,5051,5657,6263,6869,8081,9091,9293,120121,186187,188189,200201,

%T 216217,242243,246247,252253,278279,300301,308309,318319,338339,

%U 342343,350351,362363,368369,390391,402403,410411,416417,426427,428429,440441,446447,450451,452453,470471,476477,482483

%N Primes formed by the concatenation of exactly two consecutive composite numbers.

%C When a prime is obtained by the concatenation of exactly two consecutive composite numbers, the first one always ends with 0, 2, 6, 8 while the second one ends respectively with 1, 3, 7, 9.

%C a(1) = 89 is also the smallest prime whose digits are composite (A051416).

%C a(n) has an even number of digits. If it would have an odd number of digits then it is like 99..99100..00 but that is composite. - _David A. Corneth_, Feb 27 2021

%H G. L. Honaker, Jr. and Chris Caldwell, <a href="https://primes.utm.edu/curios/page.php?curio_id=646">Prime Curios! 89</a>.

%e If (2,q) is the smallest term formed by the concatenation of 2 consecutive composite numbers with each q digits: (2,1) = a(1) = 89, (2,2) = a(2) = 5051, (2,3) = a(9) = 120121, (2,4) = 10021003, (2,5) = 1001010011, (2,6) = 100010100011.

%o (PARI) isc(c) = (c>1) && ! isprime(c);

%o isok(p) = {if (isprime(p), my(d=digits(p)); for (i=1, #d-1, my(b = fromdigits(vector(i, k, d[k]))); if (d[i+1], my(c = fromdigits(vector(#d-i, k, d[k+i]))); if (isc(b) && isc(c) && ((primepi(c) - primepi(b)) == c-b-1), return (1)); ); ); ); } \\ _Michel Marcus_, Feb 27 2021

%o (PARI) first(n) = { pc = 4; my(res = vector(n)); t = 0; forcomposite(c = 6, oo, nc = pc * 10^#digits(c) + c; if(isprime(nc), t++; res[t] = nc; if(t >= n, return(res) ) ); pc = c; ) } \\ _David A. Corneth_, Feb 27 2021

%o (PARI) is(n) = { my(d = digits(n)); if(#d % 2 == 1, return(0) ); fc = fromdigits(vector(#d \ 2, i, d[i])); lc = fromdigits(vector(#d \ 2, i, d[i+#d\2])); lc - fc == 1 && !isprime(fc) && !isprime(lc) && nextprime(fc)==nextprime(lc) && isprime(n) } \\ _David A. Corneth_, Feb 27 2021

%o (Python)

%o from sympy import isprime

%o def agento(lim):

%o digs, pow10 = 1, 10

%o while True:

%o for c2 in range(max(pow10//10+1, 3), pow10, 2):

%o if not isprime(c2) and not isprime(c2-1):

%o c1c2 = (c2-1)*pow10+c2

%o if c1c2 > lim: return

%o if isprime(c1c2): yield c1c2

%o digs, pow10 = digs+1, pow10*10

%o print([an for an in agento(482483)]) # _Michael S. Branicky_, Feb 27 2021

%Y Cf. A002808, A087341.

%Y Subsequence of A030458 and A121608.

%K nonn,base

%O 1,1

%A _Bernard Schott_, Feb 26 2021