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.

A086081 Numbers m such that m and its 2's complement are both primes. In other words, m and 2^k - m (where k is the smallest power of 2 such that 2^k > m) are primes.

This page as a plain text file.
%I A086081 #21 Jun 09 2025 16:29:24
%S A086081 2,5,11,13,19,29,41,47,53,59,61,67,97,109,149,167,173,197,227,233,239,
%T A086081 251,271,283,313,331,349,373,409,433,439,499,509,521,557,563,593,641,
%U A086081 677,743,761,773,797,827,857,887,911,941,953,971,977,983,1013,1019,1021
%N A086081 Numbers m such that m and its 2's complement are both primes. In other words, m and 2^k - m (where k is the smallest power of 2 such that 2^k > m) are primes.
%C A086081 In the first 672509 primes, 64894 of them (about 9.65%) are 2's-complement primes.
%H A086081 Charles R Greathouse IV, <a href="/A086081/b086081.txt">Table of n, a(n) for n = 1..10000</a>
%F A086081 If isPrime(p) And isPrime(2^(floor(Log(p, 2)) + 1) - p) then sequence.add(p)
%F A086081 If A(x) is the counting function of the terms a(n) <= x, then A(x) = O(xloglogx/(logx)^2) [From _Vladimir Shevelev_, Dec 04 2008]
%e A086081 19 is a term because 19 is prime and (2^5 - 19) = (32 - 19) = 13 which is prime.
%e A086081 1777 is a term because 1777 is prime and (2^11 - 1777) = (2048 - 1777) = 271 which is prime.
%t A086081 Join[{2}, Select[Prime[Range[250]], PrimeQ[BitXor[#, 2^Ceiling[Log[2, #]] - 1] + 1] &]] (* _Alonso del Arte_, Feb 12 2013 *)
%o A086081 (PARI) select(m->isprime((2<<(log(m+.5)\log(2)))-m), primes(100)) \\ _Charles R Greathouse IV_, Feb 13 2013
%Y A086081 Cf. A068811.
%K A086081 nonn,easy
%O A086081 1,1
%A A086081 _Chuck Seggelin_, Jul 08 2003