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.

A125664 Numbers such that the right half of the digits form a prime and the left half do not.

Original entry on oeis.org

12, 13, 15, 17, 42, 43, 45, 47, 62, 63, 65, 67, 82, 83, 85, 87, 92, 93, 95, 97, 102, 103, 105, 107, 112, 113, 115, 117, 122, 123, 125, 127, 132, 133, 135, 137, 142, 143, 145, 147, 152, 153, 155, 157, 162, 163, 165, 167, 172, 173, 175, 177, 182, 183, 185, 187
Offset: 1

Views

Author

Cino Hilliard, Jan 29 2007

Keywords

Comments

If the number of digits in the number is odd > 1, then the middle digit is ignored.

Examples

			12 is the first number with this property.
		

Crossrefs

Cf. A125524.

Programs

  • PARI
    rightprime(n) = { local(x,ln,y,lp,rp); for(x=1,n, y=Str(x); if(x > 9, ln=floor(length(y)/2), ln=1); lp = eval(left(y,ln)); rp = eval(right(y,ln)); if(!isprime(lp)&& isprime(rp),print1(x",") ) ) }
    
  • Python
    from sympy import isprime
    def ok(n):
        if n < 10: return False
        s = str(n)
        m = len(s)//2
        return isprime(int(s[-m:])) and not isprime(int(s[:m]))
    print([k for k in range(188) if ok(k)]) # Michael S. Branicky, Dec 13 2021

Formula

The left half of an n-digit number is the first floor(n/2) digits. The right half of an n-digit number is the last floor(n/2) digits.