login
A379750
First prime of cousin prime pairs which differ, in their binary representation, by a single bit.
0
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,1
COMMENTS
The first prime of a cousin prime pair is a prime p for which p+4 is also prime.
The only way for p and p+4 to differ at a single bit position is when p has a 0 bit at its "4" position, so p == {0,1,2,3} (mod 8), and so this sequence is the intersection of A023200 and A047471.
EXAMPLE
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.
MATHEMATICA
Select[Prime[Range[480]], PrimeQ[#+4]&&Mod[#, 8]<4&] (* James C. McMahon, Mar 01 2025 *)
PROG
(Python)
import sympy
def ok(n): return (n&5)==1 and sympy.isprime(n) and sympy.isprime(n+4)
CROSSREFS
Cf. A023200 (cousin primes), A047471, A071695.
Sequence in context: A042371 A141644 A141170 * A107154 A141373 A336792
KEYWORD
nonn,base,new
AUTHOR
James S. DeArmon, Jan 01 2025
EXTENSIONS
a(45)-a(48) from James C. McMahon, Mar 01 2025
STATUS
approved