login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A342049 Primes formed by the concatenation of exactly two consecutive composite numbers. 1
89, 5051, 5657, 6263, 6869, 8081, 9091, 9293, 120121, 186187, 188189, 200201, 216217, 242243, 246247, 252253, 278279, 300301, 308309, 318319, 338339, 342343, 350351, 362363, 368369, 390391, 402403, 410411, 416417, 426427, 428429, 440441, 446447, 450451, 452453, 470471, 476477, 482483 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
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.
a(1) = 89 is also the smallest prime whose digits are composite (A051416).
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
LINKS
G. L. Honaker, Jr. and Chris Caldwell, Prime Curios! 89.
EXAMPLE
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.
PROG
(PARI) isc(c) = (c>1) && ! isprime(c);
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
(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
(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
(Python)
from sympy import isprime
def agento(lim):
digs, pow10 = 1, 10
while True:
for c2 in range(max(pow10//10+1, 3), pow10, 2):
if not isprime(c2) and not isprime(c2-1):
c1c2 = (c2-1)*pow10+c2
if c1c2 > lim: return
if isprime(c1c2): yield c1c2
digs, pow10 = digs+1, pow10*10
print([an for an in agento(482483)]) # Michael S. Branicky, Feb 27 2021
CROSSREFS
Subsequence of A030458 and A121608.
Sequence in context: A017805 A017752 A282478 * A264323 A100419 A328355
KEYWORD
nonn,base
AUTHOR
Bernard Schott, Feb 26 2021
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 29 02:23 EDT 2024. Contains 371264 sequences. (Running on oeis4.)