A241757 Numbers n such that 2n is a sum of two primes, the adding of which requires only one carry in binary.
2, 11, 15, 23, 27, 29, 39, 45, 47, 51, 55, 57, 59, 63, 71, 77, 87, 95, 99, 103, 105, 107, 111, 115, 117, 119, 123, 125, 127, 131, 135, 137, 143, 147, 149, 155, 159, 165, 171, 173, 175, 177, 179, 183, 185, 187, 189, 191, 197, 203, 207, 215, 219, 221, 223, 225
Offset: 1
Keywords
Examples
2 is in the sequence since 2*2=2+2 is a sum of two primes and adding 2+2 requires only one carry in binary.
Links
- Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
Crossrefs
Cf. A241405.
Programs
-
PARI
is(n)=if(n%2==0, return(n==2)); forprime(p=2,n,if(p%4==1 && isprime(2*n-p) && bitand(p, 2*n-p)==1, return(1))); 0 \\ Charles R Greathouse IV, Apr 29 2014
-
PARI
MSB(n)=2^(#binary(n)-1); is(n)={ if(n%2==0, return(n==2)); my(V=(n - MSB(n))>>1, k=0); while(k=bitand(k-V,V), \\ Note: assignment, not comparison my(p=4*k+1,q=2*n-p); if(isprime(p) && isprime(q), return(1)) ); 0 }; \\ Charles R Greathouse IV, Apr 30 2014
Extensions
More terms from Peter J. C. Moses, Apr 29 2014
Comments