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!)
A241757 Numbers n such that 2n is a sum of two primes, the adding of which requires only one carry in binary. 4

%I #12 Apr 30 2014 16:56:40

%S 2,11,15,23,27,29,39,45,47,51,55,57,59,63,71,77,87,95,99,103,105,107,

%T 111,115,117,119,123,125,127,131,135,137,143,147,149,155,159,165,171,

%U 173,175,177,179,183,185,187,189,191,197,203,207,215,219,221,223,225

%N Numbers n such that 2n is a sum of two primes, the adding of which requires only one carry in binary.

%C Apart from a(1), both primes are 1 mod 4, hence 2 is the only even term in the sequence. - _Charles R Greathouse IV_, Apr 29 2014

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

%e 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.

%o (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

%o (PARI) MSB(n)=2^(#binary(n)-1);

%o is(n)={

%o if(n%2==0, return(n==2));

%o my(V=(n - MSB(n))>>1, k=0);

%o while(k=bitand(k-V,V), \\ Note: assignment, not comparison

%o my(p=4*k+1,q=2*n-p);

%o if(isprime(p) && isprime(q), return(1))

%o );

%o 0

%o }; \\ _Charles R Greathouse IV_, Apr 30 2014

%Y Cf. A241405.

%K nonn

%O 1,1

%A _Vladimir Shevelev_, Apr 28 2014

%E More terms from _Peter J. C. Moses_, Apr 29 2014

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 23 07:42 EDT 2024. Contains 371905 sequences. (Running on oeis4.)