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.

Showing 1-4 of 4 results.

A105184 Primes that can be written as concatenation of two primes in decimal representation.

Original entry on oeis.org

23, 37, 53, 73, 113, 137, 173, 193, 197, 211, 223, 229, 233, 241, 271, 283, 293, 311, 313, 317, 331, 337, 347, 353, 359, 367, 373, 379, 383, 389, 397, 433, 523, 541, 547, 571, 593, 613, 617, 673, 677, 719, 733, 743, 761, 773, 797, 977, 1013, 1033, 1093
Offset: 1

Views

Author

Lekraj Beedassy, Apr 11 2005

Keywords

Comments

Primes that can be written as the concatenation of two distinct primes is the same sequence.
Number of terms < 10^n: 0, 4, 48, 340, 2563, 19019, 147249, ... - T. D. Noe, Oct 04 2010
The second prime cannot begin with the digit zero, else 307 would be the first additional term. - Michael S. Branicky, Sep 01 2024

Examples

			193 is in the sequence because it is the concatenation of the primes 19 and 3.
197 is in the sequence because it is the concatenation of the primes 19 and 7.
199 is not in the sequence because there is no way to break it into two substrings such that both are prime: neither 1 nor 99 is prime, and 19 is prime but 9 is not.
		

Crossrefs

Subsequence of A019549.

Programs

  • Mathematica
    searchMax = 10^4; Union[Reap[Do[p = Prime[i]; q = Prime[j]; n = FromDigits[Join[IntegerDigits[p], IntegerDigits[q]]]; If[PrimeQ[n], Sow[n]], {i, PrimePi[searchMax/10]}, {j, 2, PrimePi[searchMax/10^Ceiling[Log[10, Prime[i]]]]}]][[2, 1]]] (* T. D. Noe, Oct 04 2010 *)
    Select[Prime@Range@1000,
     MatchQ[IntegerDigits@#, {x__, y__} /;
        PrimeQ@FromDigits@{x} && First@{y} != 0 &&
    PrimeQ@FromDigits@{y}] &] (* Hans Rudolf Widmer, Nov 30 2024 *)
  • Python
    from sympy import isprime
    def ok(n):
        if not isprime(n): return False
        s = str(n)
        return any(s[i]!="0" and isprime(int(s[:i])) and isprime(int(s[i:])) for i in range(1, len(s)))
    print([k for k in range(1100) if ok(k)]) # Michael S. Branicky, Sep 01 2024

Extensions

Corrected and extended by Ray Chandler, Apr 16 2005
Edited by N. J. A. Sloane, May 03 2007
Edited by N. J. A. Sloane, to remove erroneous b-file, comments and Mma program, Oct 04 2010

A121609 Composite numbers that can be written as concatenation of two primes in decimal representation.

Original entry on oeis.org

22, 25, 27, 32, 33, 35, 52, 55, 57, 72, 75, 77, 112, 115, 117, 132, 133, 135, 172, 175, 177, 192, 195, 213, 217, 219, 231, 232, 235, 237, 243, 247, 253, 259, 261, 267, 273, 279, 289, 292, 295, 297, 312, 315, 319, 323, 329, 341, 343, 361, 371, 372, 375, 377
Offset: 1

Views

Author

Reinhard Zumkeller, Aug 10 2006

Keywords

Comments

Subsequence of A066737.

Examples

			A002808(249) = 315 = 31*10+5 = A000040(11)*10+A000040(3),
therefore 315 is a term: a(44) = 315;
A002808(252) = 319 = 3*100+19 = A000040(2)*100+A000040(8),
therefore 319 is a term: a(45) = 319.
		

Crossrefs

A121610 Composite numbers that can be written as concatenation of two composite numbers in decimal representation.

Original entry on oeis.org

44, 46, 48, 49, 64, 66, 68, 69, 84, 86, 88, 94, 96, 98, 99, 104, 106, 108, 124, 126, 128, 129, 144, 146, 148, 154, 156, 158, 159, 164, 166, 168, 169, 184, 186, 188, 189, 204, 206, 208, 209, 214, 216, 218, 219, 224, 226, 228, 244, 246, 248, 249, 254, 256, 258
Offset: 1

Views

Author

Reinhard Zumkeller, Aug 10 2006

Keywords

Examples

			A002808(328) = 408 = 40*10+8 = A002808(27)*10+A002808(3),
therefore 408 is a term: a(99) = 408;
A002808(331) = 412 = 4*100+12 = A002808(1)*100+A002808(6),
therefore 412 is a term: a(100) = 412.
		

Crossrefs

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
Showing 1-4 of 4 results.