login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A137985 Complementing any single bit in the binary representation of these primes produces a composite number. 9
127, 173, 191, 223, 233, 239, 251, 257, 277, 337, 349, 373, 431, 443, 491, 509, 557, 653, 683, 701, 733, 761, 787, 853, 877, 1019, 1193, 1201, 1259, 1381, 1451, 1453, 1553, 1597, 1709, 1753, 1759, 1777, 1973, 2027, 2063, 2333, 2371, 2447, 2633, 2879, 2917 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
If 2^m is the highest power of 2 in the binary representation of the prime p, there is no requirement that p+2^(m+1) be composite. Sequence A065092 imposes this extra requirement. The prime 223 is the first number in this sequence that is not in A065092.
Mentioned Feb 25 2008 by Terence Tao in his blog http://terrytao.wordpress.com. Tao proves that there are an infinite number of these primes in every fixed base.
Digitally delicate primes in base 2. - Marc Morgenegg, Apr 21 2021
REFERENCES
Cohen, Fred; Selfridge, J. L., Not every number is the sum or difference of two prime powers. Collection of articles dedicated to Derrick Henry Lehmer on the occasion of his seventieth birthday. Math. Comp. 29 (1975), 79-81. MR0376583 (51 #12758).
LINKS
Warren D. Smith et al., Primes such that every bit matters?, Yahoo group "primenumbers", April 2013.
Warren D. Smith and others, Primes such that every bit matters?, digest of 14 messages in primenumbers Yahoo group, Apr 3 - Apr 9, 2013. [Cached copy]
Terence Tao, A remark on primality testing and decimal expansions, arXiv:0802.3361 [math.NT], 2008-2010; Journal of the Australian Mathematical Society 91:3 (2011), pp. 405-413.
EXAMPLE
The numbers produced by complementing each of the 8 bits of 223 are 95, 159, 255, 207, 215, 219, 221 and 222, which are all composite.
MATHEMATICA
t={}; k=1; While[Length[t]<100, k++; p=Prime[k]; d=IntegerDigits[p, 2]; n=Length[d]; i=0; While[i<n && (d[[n-i]]==1 && !PrimeQ[p-2^i]) || (d[[n-i]]==0 && !PrimeQ[p+2^i]), i++ ]; If[i==n, AppendTo[t, p]]]; t (* T. D. Noe *)
isWPbase2[z_] := NestWhile[#*2 &, 2, (# < z && ! PrimeQ@BitXor[z, #] &)] > z; Select[Prime /@ Range[3, PrimePi[10^6]], isWPbase2@# &] (* Terentyev Oleg, Jul 17 2011 *)
PROG
(PARI)f(p)={pow2=1; v=binary(p); L=#v;
forstep(k=L, 1, -1, if(v[k], p-=pow2; if(isprime(p), return(0), p+=pow2), p+=pow2; if(isprime(p), return(0), p-=pow2)); pow2*=2); return(1)}; forprime(p=2, 2879, if(f(p), print1(p, ", "))) \\ Washington Bomfim, Jan 18 2011
(PARI) is_A137985(n)=!for(k=1, n, isprime(bitxor(n, k)) && return; k+=k-1) && isprime(n) \\ Note: A bug in early versions of PARI 2.6 (execute "for(i=0, 1, i>3 && error(buggy); i=9)" to check) makes that this is is_A065092 rather than is_A137985 as expected. For these versions, replace the upper limit n with n\2. \\ M. F. Hasler, Apr 05 2013
(Python)
from sympy import isprime, primerange
def ok(p): # p assumed prime
return not any(isprime((1<<k)^p) for k in range(p.bit_length()))
def aupto(limit):
alst = []
for p in primerange(2, limit+1):
if ok(p): alst.append(p)
return alst
print(aupto(2917)) # Michael S. Branicky, Feb 16 2021
CROSSREFS
Cf. A050249 (analogous base 10 sequence), A186995 (weak primes in base n).
A065092 is a very similar sequence.
Sequence in context: A156702 A180536 A342801 * A065092 A141916 A023689
KEYWORD
nonn,base
AUTHOR
T. D. Noe, Feb 26 2008
EXTENSIONS
Definition clarified by Chai Wah Wu, Jan 03 2019
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 19 01:34 EDT 2024. Contains 370952 sequences. (Running on oeis4.)