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-10 of 27 results. Next

A019549 Primes formed by concatenating other primes.

Original entry on oeis.org

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

Views

Author

R. Muller

Keywords

Examples

			113 is member as 11 and 3 are primes.
a(12)=227 = "2"+"2"+"7" is the first term not in A105184 (restricted to concatenation of two primes). [_M. F. Hasler_, Oct 15 2009]
		

Crossrefs

Programs

  • PARI
    is_A019549(n, recurse=0)={ isprime(n) == recurse & return(recurse); for(i=1, #Str(n)-1, isprime( n%10^i ) & is_A019549( n\10^i, 1) & n\10^(i-1)%10 & return(1)) } \\ M. F. Hasler, Oct 15 2009
    
  • Python
    from sympy import isprime
    def c(n, m):
        if m > 0 and isprime(n): return True
        s = str(n)
        return any(s[i]!="0" and isprime(int(s[:i])) and c(int(s[i:]), m+1) for i in range(1, len(s)))
    def ok(n): return isprime(n) and c(n, 0)
    print([k for k in range(978) if ok(k)]) # Michael S. Branicky, Sep 01 2024

A152242 Integers formed by concatenating primes.

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 17, 19, 22, 23, 25, 27, 29, 31, 32, 33, 35, 37, 41, 43, 47, 52, 53, 55, 57, 59, 61, 67, 71, 72, 73, 75, 77, 79, 83, 89, 97, 101, 103, 107, 109, 112, 113, 115, 117, 127, 131, 132, 133, 135, 137, 139, 149, 151, 157, 163, 167, 172, 173, 175, 177, 179
Offset: 1

Views

Author

Eric Angelini, Oct 15 2009

Keywords

Comments

Leading zeros are not allowed (cf. A166504).
For any k > 0, there are A246806(k) terms with k digits. - Rémy Sigrist, Jan 08 2023

Examples

			101 is a member since it is prime; 303 is not since it is composite and 30 is also not a prime.
		

Crossrefs

Programs

  • PARI
    is_A152242(n)=/* If n is even, the last digit must be 2 and [n\10] (if nonzero) must be in this sequence. (This check is not necessary but improves speed.) */ bittest(n,0) || return( n%10==2 && (n<10 || is_A152242(n\10))); isprime(n) && return(1); for(i=1,#Str(n)-1, n%10^i>10^(i-1) && isprime( n%10^i ) && is_A152242( n\10^i) && return(1)) \\ M. F. Hasler, Oct 15 2009; edited Oct 16 2009, to disallow leading zeros
    
  • Python
    from sympy import isprime
    def ok(n):
        if isprime(n): return True
        s = str(n)
        return any(s[i]!="0" and isprime(int(s[:i])) and ok(int(s[i:])) for i in range(1, len(s)))
    print([k for k in range(180) if ok(k)]) # Michael S. Branicky, Sep 01 2024

Extensions

More terms from M. F. Hasler and Zak Seidov, Oct 15 2009

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

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

A380943 Primes written in decimal representation by the concatenation of primes p and q such that the concatenation of q and p also forms a prime.

Original entry on oeis.org

37, 73, 113, 173, 197, 311, 313, 317, 331, 337, 359, 367, 373, 593, 617, 673, 719, 733, 761, 797, 977, 1093, 1097, 1123, 1277, 1319, 1361, 1373, 1783, 1913, 1931, 1979, 1997, 2293, 2297, 2311, 2347, 2389, 2713, 2837, 2971, 3109, 3119, 3137, 3191, 3229, 3271
Offset: 1

Views

Author

James C. McMahon, Apr 03 2025

Keywords

Comments

Member primes could be named Saint Patrick primes because the date of Saint Patrick's Day, March 17 (3/17), produces the terms 173 and 317.
The primes 37, 73, and 373 uniquely satisfy the requirements if cleaved at every possible position. - Robert G. Wilson v, May 03 2025

Examples

			Primes 173 and 317 are members because they are formed by the concatenation of 17 & 3  and 3 & 17, respectively.
While the concatenation of 13 and 7 forms the prime 137, it is not a member because the concatenation of 7 and 13 is 713, which is not prime.
		

Crossrefs

Subsequence of A019549 and A105184.
Cf. A133187.

Programs

  • Mathematica
    lim=3300; plim=Max[FromDigits[Rest[IntegerDigits[lim]]], FromDigits[Drop[IntegerDigits[lim], -1]]]; p=Prime[Range[PrimePi[plim]]];p2=Subsets[p,{2}];fp[{a_,b_}]:=FromDigits[Join[IntegerDigits[a],IntegerDigits[b]]];rfp[{a_,b_}]:=FromDigits[Join[IntegerDigits[b],IntegerDigits[a]]];pabba=Select[p2,PrimeQ[fp[#]]&&PrimeQ[rfp[#]]&];pp1=fp/@pabba;pp2=rfp/@pabba;Select[Union[Join[pp1,pp2]],#<=lim&]
  • 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:])) and isprime(int(s[i:]+s[:i])) for i in range(1, len(s)))
    print([k for k in range(3300) if ok(k)]) # Michael S. Branicky, Apr 05 2025

A238056 Primes which are the concatenation of two primes in exactly one way.

Original entry on oeis.org

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

Views

Author

Colin Barker, Feb 17 2014

Keywords

Comments

This is not a duplicate of A129800, which accepts "07" for example as the second prime.

Examples

			113 is in the sequence because 11 and 3 are both primes, but 1 and 13 are not both primes, so there is one way.
		

Crossrefs

Programs

  • Haskell
    a238056 n = a238056_list !! (n-1)
    a238056_list = filter ((== 1) . length . f) a000040_list where
      f x = filter (\(us, vs) ->
                   head vs /= '0' &&
                   a010051' (read us :: Integer) == 1 &&
                   a010051' (read vs :: Integer) == 1) $
                   map (flip splitAt $ show x) [1 .. length (show x) - 1]
    -- Reinhard Zumkeller, Feb 27 2014
  • Mathematica
    spl[n_] := Block[{d = IntegerDigits@n, c = 0, z}, z = Length@d; Do[If[PrimeQ@ FromDigits@ Take[d, k] && d[[k + 1]] > 0 && PrimeQ@ FromDigits@ Take[d, k - z], c++], {k, z - 1}]; c]; Select[ Prime@ Range@ 300, spl[#] == 1 &] (* Giovanni Resta, Feb 27 2014 *)

A238057 Primes which are the concatenation of two primes in exactly two ways.

Original entry on oeis.org

313, 317, 373, 797, 1373, 1913, 1973, 1997, 2113, 2293, 2311, 2347, 2383, 2389, 2953, 2971, 3167, 3313, 3373, 3593, 3673, 3677, 3719, 3733, 3761, 4337, 4397, 5233, 5347, 5953, 6173, 6197, 6737, 7193, 7331, 7433, 7577, 7877, 7919, 7937, 10313, 10337, 10937
Offset: 1

Views

Author

Colin Barker, Feb 17 2014

Keywords

Examples

			313 is in the sequence because 31 and 3 are both primes, and 3 and 13 are both primes, so there are two ways.
		

Crossrefs

Programs

  • Haskell
    a238057 n = a238057_list !! (n-1)
    a238057_list = filter ((== 2) . length . f) a000040_list where
      f x = filter (\(us, vs) ->
                   head vs /= '0' &&
                   a010051' (read us :: Integer) == 1 &&
                   a010051' (read vs :: Integer) == 1) $
                   map (flip splitAt $ show x) [1 .. length (show x) - 1]
    -- Reinhard Zumkeller, Feb 27 2014
  • Mathematica
    spl[n_] := Block[{d = IntegerDigits@n, c = 0, z}, z = Length@d; Do[ If[ PrimeQ@ FromDigits@ Take[d, k] && d[[k + 1]] > 0 && PrimeQ@ FromDigits@ Take[d, k - z], c++], {k, z - 1}]; c]; Select[ Prime@ Range@1400, spl[#] == 2 &] (* Giovanni Resta, Feb 27 2014 *)

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

A383815 Palindromic primes in A380943.

Original entry on oeis.org

313, 373, 797, 11311, 13331, 13931, 17971, 19991, 31013, 35353, 36263, 36563, 38783, 71317, 79397, 97379, 98389, 1129211, 1196911, 1611161, 1793971, 1982891, 3106013, 3166613, 3193913, 3236323, 3288823, 3304033, 3319133, 3329233, 3365633, 3417143, 3447443, 3449443, 3515153, 3670763
Offset: 1

Views

Author

Keywords

Comments

A380943 requires that primes, p_n, written in decimal representation by the concatenation of primes p and q such that the concatenation of q and p also forms a prime.
Intersection of A002385 and A380943.

Examples

			The palindromic prime 313 is formed by the concatenation of the primes 31 and 3, which reversed, also form the prime 331. The palindromic prime 13931 is formed by the concatenation of 139 and 31; 31139 is also prime.
		

Crossrefs

Programs

  • Maple
    rev:= proc(n) local L,i;
       L:= convert(n,base,10);
       add(L[-i]*10^(i-1),i=1..nops(L))
    end proc:
    tcat:= proc(x,y) y + 10^(ilog10(y)+1)*x end proc:
    filter:= proc(z) local i,x,y;
      if not isprime(z) then return false fi;
      for i from 1 to ilog10(z) do
        x:= z mod 10^i;
        if x < 10^(i-1) then next fi;
        y:= (z-x)/10^i;
        if isprime(x) and isprime(y) and isprime(tcat(x,y)) then return true fi;
      od;
      false
    end proc:
    N:= 7: # for terms of up to 7 digits
    R:= NULL:
    for d from 1 to (N-1)/2 do
      for x from 10^(d-1) to 10^d-1 do
        for y from 0 to 9 do
          z:= rev(x) + 10^d * y + 10^(d+1)*x;
          if filter(z) then R:= R,z fi
    od od od:
    R;  # Robert Israel, Jun 08 2025
  • Mathematica
    f[n_] := Block[{cnt = 0, id = IntegerDigits@ n, k = 1, len, p, q, qp}, len = Length@ id; While[k < len, p = Take[id, k]; q = Take[id, -len + k]; qp = FromDigits[Join[q, p]]; If[ PrimeQ@ FromDigits@ p && PrimeQ@ FromDigits@ q && PrimeQ@ qp && IntegerLength@ qp == len, cnt++]; k++]; cnt]; fQ[n_] := Reverse[idn = IntegerDigits@ n] == idn && f@ n > 0; Select[ Prime@ Range@ 264000, fQ]

A383816 Palindromic primes which satisfy the requirements of A380943 in at least two ways.

Original entry on oeis.org

373, 1793971, 7933397, 374636473, 714707417, 727939727, 787333787, 790585097, 947939749, 991999199, 10253935201, 11365556311, 11932823911, 13127372131, 34390609343, 35369996353, 35381318353, 36297179263, 37018281073, 37423332473, 37773537773, 38233333283, 38914541983, 39064546093
Offset: 1

Views

Author

Keywords

Comments

Terms of A380943 are primes whose decimal representation is the concatenation of primes p and q such that the concatenation of q and p also forms a prime.

Examples

			The palindromic prime 373 meets the requirements of A380943 in two ways: the concatenation of 3 and 37 forms the prime 337, and the concatenation of 73 and 3 forms the prime 733.
Although 37673 is a palindrome where 3, 7673, and 76733 are all primes and 3767, 3, and 33767 are all primes, the palindrome is not prime and is therefore not in the sequence.
		

Crossrefs

Subsequence of A383810.

Programs

  • Mathematica
    f[n_] := Block[{cnt = 0, id = IntegerDigits@ n, k = 1, len, p, q, qp}, len = Length@ id; While[k < len, p = Take[id, k]; q = Take[id, -len + k]; qp = FromDigits[Join[q, p]]; If[ PrimeQ@ FromDigits@ p && PrimeQ@ FromDigits@ q && PrimeQ@ qp && IntegerLength@ qp == len, cnt++]; k++]; cnt]; fQ[n_] := Reverse[idn = IntegerDigits@ n] == idn && f@ n > 1; Select[ Prime@ Range@ 3000000, fQ]
Showing 1-10 of 27 results. Next