cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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

Original entry on oeis.org

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
Offset: 1

Views

Author

Bernard Schott, Feb 26 2021

Keywords

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

Examples

			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.
		

Crossrefs

Subsequence of A030458 and A121608.

Programs

  • 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