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.

A368214 Primes with a single 0-bit in binary expansion such that changing the position of the 0-bit always gives a nonprime (including the one with a leading zero).

Original entry on oeis.org

2, 2039, 6143, 522239, 33546239, 260046847, 16911433727, 32212254719, 2196875771903, 140735340871679, 2251799813685119, 9005000231485439, 576460752169205759, 36893488147410714623, 147573811852188057599, 9444732965739282038783, 154742504910672534362390399
Offset: 1

Views

Author

Ya-Ping Lu, Dec 23 2023

Keywords

Comments

It seems that most of the terms end with '9', followed by those ending with '3', '7', and '1'.

Examples

			2 is a term because 2 is a prime with one '0' in binary form ('10') and '01' is not a prime. 2039 is a term because 2039 is a prime with one '0' in binary form ('11111110111') and changing the position of the '0', for example, '11111111011' = 2043 and '01111111111' = 1023, always results in a composite.
		

Crossrefs

Subsequence of A095078.

Programs

  • Python
    from sympy import isprime
    for n in range(1,100):
        s = n*'1'; c = 0
        for j in range(n+1):
            num = int(s[:j]+'0'+s[j:], 2)
            if isprime(num):
                c += 1
                if c == 1: r = num
                if c == 2: break
        if c == 1: print(r, end = ', ')