login
Numbers k such that the k-th prime has an even number of 1's in binary expansion and the (k+1)st prime also has an even number of 1's.
3

%I #16 Jul 25 2021 20:46:07

%S 2,9,23,34,55,56,59,68,69,70,71,76,91,96,108,124,141,146,147,154,165,

%T 182,183,184,199,200,208,213,214,221,222,225,226,227,236,239,240,245,

%U 252,255,256,269,280,283,286,289,290,291,292,327,339,355,356,359,365,393,396,397,406,414,419,420

%N Numbers k such that the k-th prime has an even number of 1's in binary expansion and the (k+1)st prime also has an even number of 1's.

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

%t Select[Range[1000], EvenQ[DigitCount[Prime[ # ], 2][[1]]] && EvenQ[DigitCount[Prime[ # + 1], 2][[1]]] &] (* _Stefan Steinerberger_, Apr 21 2006 *)

%o (PARI) is(n)=my(p=prime(n)); hammingweight(p)%2==0 && hammingweight(nextprime(p+1))%2==0 \\ _Charles R Greathouse IV_, Mar 29 2013

%K nonn

%O 1,1

%A _N. J. A. Sloane_

%E More terms from Scott Lindhurst (ScottL(AT)alumni.princeton.edu)