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-7 of 7 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

A106582 Numbers which are the concatenation of two primes.

Original entry on oeis.org

22, 23, 25, 27, 32, 33, 35, 37, 52, 53, 55, 57, 72, 73, 75, 77, 112, 113, 115, 117, 132, 133, 135, 137, 172, 173, 175, 177, 192, 193, 195, 197, 211, 213, 217, 219, 223, 229, 231, 232, 233, 235, 237, 241, 243, 247, 253, 259, 261, 267, 271, 273, 279, 283, 289
Offset: 1

Views

Author

Keywords

Comments

A105184 and A121609 are subsequences.

Examples

			133 is in the sequence because 133 = 13*10+3 = A000040(6)*10+A000040(2).
		

Crossrefs

Programs

  • Mathematica
    nn=500; t=Union[Reap[Do[n=FromDigits[Join[IntegerDigits[Prime[i]], IntegerDigits[Prime[j]]]]; If[n<=nn, Sow[n]], {i,PrimePi[nn/10]}, {j,PrimePi[nn/IntegerDigits[nn][[1]]]}]][[2,1]]] (* T. D. Noe, Mar 11 2011 *)
    Take[FromDigits[Flatten[IntegerDigits/@#]]&/@Tuples[Prime[Range[30]],2]//Union,60] (* Harvey P. Dale, May 28 2025 *)
  • Python
    from sympy import isprime
    from itertools import count, islice
    def agen(): # generator of terms
        for k in count(1):
            s = str(k)
            if any(s[i] != '0' and isprime(int(s[:i])) and isprime(int(s[i:])) for i in range(1, len(s))):
                yield k
    print(list(islice(agen(), 55))) # Michael S. Branicky, Feb 26 2022

Extensions

Corrected by Arkadiusz Wesolowski, Mar 11 2011

A066737 Composite numbers that are concatenations of primes.

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, 222, 225, 231, 232, 235, 237, 243, 247, 252, 253, 255, 259, 261, 267, 272, 273, 275, 279, 289, 292, 295, 297, 312, 315, 319, 322, 323, 325
Offset: 1

Views

Author

Joseph L. Pe, Jan 15 2002

Keywords

Examples

			72 is the concatenation of primes 7 and 2. 132 is the concatenation of primes 13 and 2. 225 is the concatenation of 2, 2 and 5.
		

Crossrefs

Cf. A121609.

Programs

  • Maple
    ccat:= proc(m,n) 10^(1+ilog10(n))*m+n end proc:
    C[1]:= {2,3,5,7}: P[1]:=C[1]:
    for n from 2 to 3 do
      P[n]:= select(isprime, {seq(i,i=10^(n-1)+1..10^n-1,2)});
      C[n]:= P[n];
      for m from 1 to n-1 do
        C[n]:= C[n] union {seq(seq(ccat(p,q),p =P[m]),q=C[n-m])};
      od
    od:
    seq(op(sort(convert(remove(isprime,C[n]),list))),n=1..3); # Robert Israel, Jan 22 2020
  • PARI
    for(n=1,999, !isprime(n) && is_A152242(n) && print1(n", ")) \\ M. F. Hasler, Oct 16 2009

Formula

A066737 = A152242 \ A000040 = A152242 intersect A002808. - M. F. Hasler, Oct 16 2009

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), Apr 03 2002
Missing terms added by M. F. Hasler, Oct 16 2009

A121608 Primes that can be written as concatenation of two composite numbers in decimal representation.

Original entry on oeis.org

89, 109, 149, 229, 269, 349, 359, 389, 409, 421, 433, 439, 449, 457, 463, 487, 491, 499, 509, 569, 659, 677, 691, 709, 769, 809, 821, 827, 829, 839, 857, 859, 863, 877, 881, 887, 919, 929, 977, 991, 1009, 1021, 1033, 1039, 1049, 1051, 1063, 1069, 1087, 1091
Offset: 1

Views

Author

Reinhard Zumkeller, Aug 10 2006

Keywords

Examples

			A000040(169) = 1009 = 100*10+9 = A002808(74)*10+A002808(4), therefore 1009 is a term: a(41) = 1009;
A000040(172) = 1021 = 10*100+21 = A002808(5)*100+A002808(12), therefore 1021 is a term: a(42) = 1021.
		

Crossrefs

Programs

  • Python
    from sympy import isprime
    def comp(s): i=int(s); return s[0]!='0' and i > 1 and not isprime(i)
    def ok(n):
      s = str(n)
      for i in range(1, len(s)):
        if comp(s[:i]) and comp(s[i:]) and isprime(int(s)): return True
    print([m for m in range(1092) if ok(m)]) # Michael S. Branicky, Feb 27 2021

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

A167459 Composite numbers in A166504, i.e., whose decimal expansion can be split up into prime numbers, with leading zeros allowed.

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, 202, 203, 205, 207, 213, 217, 219, 222, 225, 231, 232, 235, 237, 243, 247, 252, 253, 255, 259, 261, 267, 272, 273, 275, 279, 289, 292, 295, 297, 302, 303
Offset: 1

Views

Author

M. F. Hasler, Nov 19 2009

Keywords

Comments

In contrast to A066737 (which is a subsequence of this one), we allow for leading zeros in the "prime" substrings; the two sequences differ from n=24 on, with a(24)=202 which is not in A066737.
Sequence A166505 gives the difference, A167459 \ A066737 = A166504 \ A152242. Sequence A167458 gives the indices of the terms not in A066737.

Crossrefs

Programs

Formula

A167459 = A002808 n A166504, where "n" means intersection.

A278799 Prime numbers that can be written as concatenation of two nonprimes in decimal representation.

Original entry on oeis.org

11, 19, 41, 61, 89, 101, 109, 127, 139, 149, 151, 157, 163, 181, 191, 193, 199, 211, 229, 241, 251, 269, 271, 281, 331, 349, 359, 389, 401, 409, 421, 433, 439, 449, 457, 461, 463, 487, 491, 499, 509, 521, 541, 569, 571, 601, 631, 641, 659, 661, 677, 691, 701, 709, 751, 761, 769, 809
Offset: 1

Views

Author

Eric Angelini and Jean-Marc Falcoz, Nov 28 2016

Keywords

Comments

This is not A066738 as we concatenate exactly two nonprimes here.
A121609 is the dual sequence where "prime" and "nonprime" are switched in the definition.

Examples

			11 (prime) is the concatenation of "1" (nonprime) and "1" (nonprime); the next prime term cannot be 13 as "3" is a concatenated prime; the next prime term cannot be 17 as "7" is a concatenated prime; the next prime term is 19 as "1" and "9" are both nonprimes; the next prime term cannot be less than 41 because all terms < 41 and > 19 start with either a "2" or a "3", which are primes; etc.
		

Crossrefs

Programs

  • PARI
    is(n)=if(!isprime(n), return(0)); my(d=digits(n)); for(i=2,#d, if(d[i] && !isprime(fromdigits(d[1..i-1])) && !isprime(fromdigits(d[i..#d])), return(1))); 0 \\ Charles R Greathouse IV, Nov 28 2016
Showing 1-7 of 7 results.