A366550 Numbers k such that bitwise AND of prime(k) and prime(k+1) = 1.
2, 6, 18, 54, 564, 3512, 6542, 564163, 2063689, 54400028, 5586502348, 252252704148404, 971269945245201, 3745011184713964
Offset: 1
Examples
18 is a term since prime(18) AND prime(19) = 1, prime(18) = 61 = binary 0111101 prime(19) = 67 = binary 1000011 bitwise AND = 0000001
Programs
-
Mathematica
A366550list[upto_]:=PrimePi[Select[2^Range[upto],BitAnd[NextPrime[#],NextPrime[#,-1]]==1&]]; A366550list[37] (* Uses formula, considering values in A214415 up to 37 *)
-
PARI
isok(k) = bitand(prime(k), prime(k+1)) == 1; \\ Michel Marcus, Oct 14 2023
Comments