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.

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