login
Numbers k such that bitwise AND of prime(k) and prime(k+1) = 1.
1

%I #28 Oct 15 2023 22:03:05

%S 2,6,18,54,564,3512,6542,564163,2063689,54400028,5586502348,

%T 252252704148404,971269945245201,3745011184713964

%N Numbers k such that bitwise AND of prime(k) and prime(k+1) = 1.

%C Suggested by a comment by _Alex Ratushnyak_ in A175330.

%F a(n) = A007053(A214415(n-1)).

%e 18 is a term since prime(18) AND prime(19) = 1,

%e prime(18) = 61 = binary 0111101

%e prime(19) = 67 = binary 1000011

%e bitwise AND = 0000001

%t A366550list[upto_]:=PrimePi[Select[2^Range[upto],BitAnd[NextPrime[#],NextPrime[#,-1]]==1&]];

%t A366550list[37] (* Uses formula, considering values in A214415 up to 37 *)

%o (PARI) isok(k) = bitand(prime(k), prime(k+1)) == 1; \\ _Michel Marcus_, Oct 14 2023

%Y Positions of ones in A175330.

%Y Cf. A007053, A214415.

%K nonn,base,hard,more

%O 1,1

%A _Paolo Xausa_, Oct 13 2023