cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A379750 First prime of cousin prime pairs which differ, in their binary representation, by a single bit.

Original entry on oeis.org

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

Views

Author

James S. DeArmon, Jan 01 2025

Keywords

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.

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.
		

Crossrefs

Cf. A023200 (cousin primes), A047471, A071695.

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