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!)
A086081 Numbers n such that n and its 2's complement are both primes. In other words, n and 2^k - n (where k is the smallest power of 2 such that 2^k > n) are primes. 6

%I #12 May 13 2013 01:54:07

%S 2,5,11,13,19,29,41,47,53,59,61,67,97,109,149,167,173,197,227,233,239,

%T 251,271,283,313,331,349,373,409,433,439,499,509,521,557,563,593,641,

%U 677,743,761,773,797,827,857,887,911,941,953,971,977,983,1013,1019,1021

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

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

%H Charles R Greathouse IV, <a href="/A086081/b086081.txt">Table of n, a(n) for n = 1..10000</a>

%F If isPrime(p) And isPrime(2^(floor(Log(p, 2)) + 1) - p) then sequence.add(p)

%F 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 a(5) = 19 because 19 is prime and (2^5 - 19) = (32 - 19) = 13 which is prime.

%e a(74) = 1777 because 1777 is prime and (2^11 - 1777) = (2048 - 1777) = 271 which is prime.

%t Join[{2}, Select[Prime[Range[250]], PrimeQ[BitXor[#, 2^Ceiling[Log[2, #]] - 1] + 1] &]] (* _Alonso del Arte_, Feb 12 2013 *)

%o (PARI) select(n->isprime((2<<(log(n+.5)\log(2)))-n), primes(100)) \\ _Charles R Greathouse IV_, Feb 13 2013

%Y Cf. A068811.

%K nonn,easy

%O 1,1

%A Chuck Seggelin (barkeep(AT)plastereddragon.com), Jul 08 2003

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 April 24 09:42 EDT 2024. Contains 371935 sequences. (Running on oeis4.)