%I #25 Jul 16 2023 02:07:57
%S 3,11,19,59,67,107,131,179,211,227,283,307,331,419,563,587,659,787,
%T 1019,1051,1123,1163,1171,1187,1291,1531,1571,1667,1787,1979,2011,
%U 2027,2099,2131,2243,2339,2371,2579,2819,2939,3083,3203,3323,3331,3547,3571,3803
%N Primes p such that A000120(p - 1) = A000120(p + 1) = 2^k for some k.
%H Charles R Greathouse IV, <a href="/A238362/b238362.txt">Table of n, a(n) for n = 1..10000</a>
%e 3 is in this sequence because A000120(3-1) = A000120(3+1) = 2^0 = 1.
%t Select[Prime[Range[500]], (s = DigitCount[#-1, 2, 1]) == DigitCount[#+1, 2, 1] && s == 2^IntegerExponent[s, 2] &] (* _Amiram Eldar_, Jul 16 2023 *)
%o (PARI) ispow2(n)=n>>=valuation(n,2);n==1
%o is(n)=my(h=hammingweight(n-1)); ispow2(h) && h==hammingweight(n+1) && isprime(n) \\ _Charles R Greathouse IV_, Mar 05 2014
%Y Cf. A000120.
%K nonn,base
%O 1,1
%A _Ilya Lopatin_ and _Juri-Stepan Gerasimov_, Feb 25 2014
%E 2311 removed by _Giovanni Resta_, Mar 01 2014