A379750 First prime of cousin prime pairs which differ, in their binary representation, by a single bit.
3, 19, 43, 67, 97, 163, 193, 307, 313, 379, 457, 499, 643, 673, 739, 769, 859, 883, 907, 937, 1009, 1297, 1483, 1489, 1579, 1609, 1867, 1873, 1993, 2083, 2137, 2203, 2347, 2377, 2473, 2539, 2617, 2659, 2683, 2689, 2707, 2833, 2857, 2953, 3019, 3163, 3187, 3217
Offset: 1
Examples
3 is a term since it's a cousin prime with 7 and their respective binary representations 011 and 111 differ at a single bit position. 13 is not a term since, although it's a cousin prime with 17, their respective binary representations 1101 and 10001 differ at more than a single bit position.
Programs
-
Mathematica
Select[Prime[Range[480]], PrimeQ[#+4]&&Mod[#,8]<4&] (* James C. McMahon, Mar 01 2025 *)
-
Python
import sympy def ok(n): return (n&5)==1 and sympy.isprime(n) and sympy.isprime(n+4)
Extensions
a(45)-a(48) from James C. McMahon, Mar 01 2025
Comments