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).

This page as a plain text file.
%I A368214 #18 Jan 22 2024 06:35:41
%S A368214 2,2039,6143,522239,33546239,260046847,16911433727,32212254719,
%T A368214 2196875771903,140735340871679,2251799813685119,9005000231485439,
%U A368214 576460752169205759,36893488147410714623,147573811852188057599,9444732965739282038783,154742504910672534362390399
%N 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).
%C A368214 It seems that most of the terms end with '9', followed by those ending with '3', '7', and '1'.
%e A368214 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.
%o A368214 (Python)
%o A368214 from sympy import isprime
%o A368214 for n in range(1,100):
%o A368214     s = n*'1'; c = 0
%o A368214     for j in range(n+1):
%o A368214         num = int(s[:j]+'0'+s[j:], 2)
%o A368214         if isprime(num):
%o A368214             c += 1
%o A368214             if c == 1: r = num
%o A368214             if c == 2: break
%o A368214     if c == 1: print(r, end = ', ')
%Y A368214 Subsequence of A095078.
%Y A368214 Cf. A039986, A081118, A095058, A138290, A208083.
%K A368214 base,nonn
%O A368214 1,1
%A A368214 _Ya-Ping Lu_, Dec 23 2023