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 13 results. Next

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

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

A100607 Concatenated primes of order 3.

Original entry on oeis.org

223, 227, 233, 257, 277, 337, 353, 373, 523, 557, 577, 727, 733, 757, 773, 1123, 1153, 1327, 1373, 1723, 1733, 1753, 1777, 1933, 1973, 2113, 2137, 2213, 2237, 2243, 2267, 2273, 2293, 2297, 2311, 2333, 2341, 2347, 2357, 2371, 2377, 2383, 2389, 2417, 2437
Offset: 1

Views

Author

Parthasarathy Nambi, Nov 30 2004

Keywords

Comments

This is a subset of all concatenated primes (A019549). Some of these primes have dual order - example 223. It can be viewed as order two(2 and 23) or as order three (2,2 and 3).
There are 15 such numbers less than 1000 and 202 less than 10^4. - Robert G. Wilson v, Dec 03 2004

Examples

			257 is in the sequence since it is made from three (distinct) primes.
		

Crossrefs

Programs

  • Maple
    filter:= proc(n) local m, i, j, ni, nj, np, n3;
     if not isprime(n) then return false fi;
     m:= ilog10(n);
     for i from 1 to m-1 do
       ni:= n mod 10^i;
       if ni < 10^(i-1) or not isprime(ni) then next fi;
       np:= (n-ni)/10^i;
       for j from 1 to m-i do
         nj:= np mod 10^j;
         if nj < 10^(j-1) then next fi;
         n3:= (np-nj)/10^j;
         if  isprime(nj) and isprime(n3) then return true fi;
     od od;
     false
    end proc;
    select(filter, [seq(i,i=3..10000,2)]); # Robert Israel, Apr 28 2025
  • Mathematica
    (* first do *) Needs["DiscreteMath`Combinatorica`"] (* then *) t = Sort[ KSubsets[ Flatten[ Table[ Prime[ Range[25]], {3}]], 3]]; lst = {}; Do[k = 1; u = Permutations[t[[n]]]; While[k < Length[u], v = FromDigits[ Flatten[ IntegerDigits /@ u[[k]]]]; If[ PrimeQ[v], AppendTo[lst, v]]; k++ ], {n, Length[t]}]; Take[ Union[lst], 45] (* Robert G. Wilson v, Dec 03 2004 *)

Formula

Each of the listed primes is made from three primes (same or different).

Extensions

Corrected and extended by Robert G. Wilson v, Dec 03 2004

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

A217263 Composite numbers such that every concatenation of their prime factors is prime.

Original entry on oeis.org

21, 33, 51, 63, 93, 111, 133, 177, 201, 219, 247, 253, 327, 411, 427, 549, 573, 589, 657, 679, 687, 763, 793, 813, 833, 889, 993, 1077, 1081, 1119, 1127, 1243, 1339, 1347, 1401, 1411, 1497, 1501, 1603, 1623, 1651, 1671, 1821, 1839, 1843, 1851, 1981, 2009, 2019
Offset: 1

Views

Author

Dmitri Kamenetsky, Sep 29 2012

Keywords

Comments

The smallest term with 3 or more prime factors is 63 = 3*3*7 (see A217264).
The smallest term with 4 or more prime factors is 21249 = 3*3*3*787 (see A217265).
The smallest term with 5 or more prime factors is 146461 = 7*7*7*7*61.
There is no term under 10^8 with 6 or more prime factors.
The smallest term with 3 or more distinct prime factors is 3311 = 7*11*43 (see A180679).
There is no term under 10^8 with 4 or more distinct prime factors.

Examples

			21 is 3*7. Both 37 and 73 are prime, so 21 is in the sequence.
63 is 3*3*7. 337, 373 and 733 are all prime, so 63 is in the sequence.
		

Crossrefs

Cf. A217264, A217265, A180679, A181559. Related sequences: A105184, A019549 and A106582.

A166503 Numbers k with property that k^2 is the concatenation of two or more prime numbers.

Original entry on oeis.org

5, 15, 17, 19, 23, 27, 49, 51, 53, 69, 73, 77, 85, 87, 107, 109, 115, 123, 141, 147, 151, 153, 157, 159, 163, 165, 171, 173, 177, 181, 187, 191, 199, 219, 229, 231, 233, 235, 239, 241, 243, 267, 269, 277, 279, 281, 289, 299, 319, 327, 331, 335, 337, 343, 357
Offset: 1

Views

Author

Zak Seidov, Oct 15 2009

Keywords

Comments

Only odd numbers are eligible.

Crossrefs

Programs

Formula

a(n) = sqrt(A038692(n)).

Extensions

Terms updated according to stricter definition of A152242 by M. F. Hasler, Oct 15 2009

A133187 Prime numbers formed by the concatenation of q and p, where q > p are also primes.

Original entry on oeis.org

53, 73, 113, 137, 173, 193, 197, 233, 293, 313, 317, 373, 433, 593, 613, 617, 673, 677, 733, 797, 977, 1013, 1033, 1093, 1097, 1277, 1373, 1493, 1637, 1733, 1913, 1933, 1973, 1993, 1997, 2113, 2237, 2273, 2293, 2297, 2311, 2333, 2393, 2417, 2633, 2693, 2713
Offset: 1

Views

Author

Tom Mueller (muel4503(AT)uni-trier.de), Dec 17 2007

Keywords

Comments

These numbers are called Caesar primes because the birth date of Julius Caesar (July 13th) provides one example of such a number, i.e. p=7 and q=13 give the prime 137.

Crossrefs

Programs

  • Mathematica
    lim=2700;plim=Max[FromDigits[Rest[IntegerDigits[lim]]],FromDigits[Drop[IntegerDigits[lim],-1]]];f2p[{p_,q_}]:=FromDigits[Join[IntegerDigits[q],IntegerDigits[p]]];p=Prime[Range[PrimePi[plim]]];p2=Subsets[p,{2}];Union[Select[f2p/@p2,PrimeQ[#]&&#<=lim&]] (* James C. McMahon, Mar 12 2025 *)
  • Python
    from sympy import isprime
    def ok(n):
        if not isprime(n): return False
        s = str(n)
        return any(s[i]!='0' and (q:=int(s[:i])) > (p:=int(s[i:])) and isprime(q) and isprime(p) for i in range(1, len(s)))
    print([k for k in range(2800) if ok(k)]) # Michael S. Branicky, Apr 05 2025

Extensions

a(27)-a(47) from James C. McMahon, Mar 12 2025

A225135 Squares that are a concatenation of primes.

Original entry on oeis.org

25, 225, 289, 361, 529, 729, 2025, 2401, 2601, 2809, 3025, 4761, 5041, 5329, 5929, 7225, 7569, 11025, 11449, 11881, 13225, 15129, 19881, 20449, 21609, 22801, 23409, 24649, 25281, 26569, 27225, 29241, 29929, 31329, 32041, 32761, 34969, 36481, 39601, 47089
Offset: 1

Views

Author

Keywords

Comments

Lim inf a(n)/n^2 >= 2. Is it finite? - Charles R Greathouse IV, Apr 30 2013

Examples

			25 = 5^2 and can be separated into two prime numbers: 2|5.
231361 = 481^2 and can be separated into prime numbers in six ways: 2|3|1361, 2|3|13|61, 2|31|3|61, 2|313|61, 23|1361, and 23|13|61.
Leading zeros are allowed: 2025 = 2|02|5.
		

Crossrefs

Programs

  • Mathematica
    r[d_] := Catch@ Block[{z = Length@d}, z<1 || Do[ If[ PrimeQ@ FromDigits@ Take[d, i] && r@ Take[d, i-z], Throw@ True], {i, z}]]; Select[ Range[1000]^2, r@ IntegerDigits@ # &] (* Giovanni Resta, Apr 30 2013 *)
  • PARI
    has(n)=if(isprime(n),return(1)); if(n<202,return(isprime(n%10) && isprime(n\10))); my(k=n%10,v);if(k==5||k==2,return(if(n<6,1,n\=10;has(n/10^valuation(n,10)))));if(k%2==0,return(0));v=digits(n);for(i=1,#v,if(isprime(n%10^i) && has(n\10^i), return(1))); 0
    forstep(n=5,1e3,2,if(has(n^2),print1(n^2", ")))
    \\ Charles R Greathouse IV, Apr 30 2013
  • R
    library(gmp); isprime2=function(x) isprime(x)>0
    splithasproperty<-function(n,FUN,curdig=1,res=list(),curspl=c()) {
    no0<-function(s){ while(substr(s,1,1)=="0" & nchar(s)>1) s=substr(s,2,nchar(s)); s}
        s=as.character(n)
        if(curdig>nchar(s)) return(res)
        if(length(curspl)>0) if(FUN(as.bigz(no0(substr(s,curdig,nchar(s)))))) res[[length(res)+1]]=curspl
        for(i in curdig:nchar(s))
            if(FUN(as.bigz(no0(substr(s,curdig,i)))))
                res=splithasproperty(n,FUN,i+1,res,c(curspl,i))
        res
    }
    which(sapply(1:100,function(x) length(splithasproperty(x^2,isprime2)))>0)^2
    

A214755 Primes formed by concatenating odd primes.

Original entry on oeis.org

37, 53, 73, 113, 137, 173, 193, 197, 233, 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, 733, 743, 757, 761, 773, 797, 977, 1013, 1033, 1093, 1097, 1117, 1123, 1129, 1153
Offset: 1

Views

Author

Alex Ratushnyak, Aug 03 2012

Keywords

Comments

Subsequence of A019549.

Crossrefs

Programs

  • Python
    from sympy import primerange
    oddPrimes = list(primerange(3, 1154))
    def tryPartitioning(binString):  # First digit is not 0
        l = len(binString)
        for t in range(1, l):
            substr1 = binString[:t]
            if (int(substr1) in oddPrimes) or (t>=2 and tryPartitioning(substr1)):
                substr2 = binString[t:]
                if substr2[0]!='0':
                    if (int(substr2) in oddPrimes) or (l-t>=2 and tryPartitioning(substr2)):
                        return 1
        return 0
    for p in oddPrimes:
        if tryPartitioning(str(p)):
            print(p, end=', ')

A225136 Numbers that are concatenations of triprimes.

Original entry on oeis.org

88, 128, 188, 208, 278, 288, 308, 428, 448, 458, 508, 528, 638, 668, 688, 708, 758, 768, 788, 808, 812, 818, 820, 827, 828, 830, 842, 844, 845, 850, 852, 863, 866, 868, 870, 875, 876, 878, 888, 892, 898, 899, 928, 988, 998, 1028, 1058, 1108, 1148, 1168, 1178
Offset: 1

Views

Author

Keywords

Examples

			88 = 8|8, both of which are triprime because 8=2*2*2.
458 = 45 | 8 = 3*3*5 | 2*2*2.
12428 can be split into triprimes in three ways: 12|428, 12|42|8, and 124|28.
		

Crossrefs

Programs

  • R
    library(gmp); istriprime=function(x) ifelse(x<8,F,length(factorize(x))==3)
    splithasproperty<-function(n,FUN,curdig=1,res=list(),curspl=c()) {
    no0<-function(s){ while(substr(s,1,1)=="0" & nchar(s)>1) s=substr(s,2,nchar(s)); s}
        s=as.character(n)
        if(curdig>nchar(s)) return(res)
        if(length(curspl)>0) if(FUN(as.bigz(no0(substr(s,curdig,nchar(s)))))) res[[length(res)+1]]=curspl
        for(i in curdig:nchar(s))
            if(FUN(as.bigz(no0(substr(s,curdig,i)))))
                res=splithasproperty(n,FUN,i+1,res,c(curspl,i))
        res
    }
    which(sapply(1:500,function(x) length(splithasproperty(x,istriprime)))>0)
Showing 1-10 of 13 results. Next