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.

Original entry on oeis.org

2, 5, 11, 13, 19, 29, 41, 47, 53, 59, 61, 67, 97, 109, 149, 167, 173, 197, 227, 233, 239, 251, 271, 283, 313, 331, 349, 373, 409, 433, 439, 499, 509, 521, 557, 563, 593, 641, 677, 743, 761, 773, 797, 827, 857, 887, 911, 941, 953, 971, 977, 983, 1013, 1019, 1021
Offset: 1

Views

Author

Chuck Seggelin, Jul 08 2003

Keywords

Comments

In the first 672509 primes, 64894 of them (about 9.65%) are 2's-complement primes.

Examples

			19 is a term because 19 is prime and (2^5 - 19) = (32 - 19) = 13 which is prime.
1777 is a term because 1777 is prime and (2^11 - 1777) = (2048 - 1777) = 271 which is prime.
		

Crossrefs

Cf. A068811.

Programs

  • Mathematica
    Join[{2}, Select[Prime[Range[250]], PrimeQ[BitXor[#, 2^Ceiling[Log[2, #]] - 1] + 1] &]] (* Alonso del Arte, Feb 12 2013 *)
  • PARI
    select(m->isprime((2<<(log(m+.5)\log(2)))-m), primes(100)) \\ Charles R Greathouse IV, Feb 13 2013

Formula

If isPrime(p) And isPrime(2^(floor(Log(p, 2)) + 1) - p) then sequence.add(p)
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]