OFFSET
1,1
COMMENTS
EXAMPLE
166273 is in the sequence because the 4 consecutive primes are:
166273 = 101000100110000001_2
166289 = 101000100110010001_2
166297 = 101000100110011001_2
166301 = 101000100110011101_2
and the successive binary Hamming distances are 1, 1, 1.
166297 is not in the sequence because the 4 consecutive primes are:
166297 = 101000100110011001_2
166301 = 101000100110011101_2
166303 = 101000100110011111_2
166319 = 101000100110101111_2
and the successive binary Hamming distances are 1, 1, 2.
MATHEMATICA
Select[Partition[Prime[Range[26000]], 4, 1], AllTrue[DigitSum[BitXor @@@ Partition[#, 2, 1], 2], # == 1 &] &][[;; , 1]] (* Amiram Eldar, Jan 27 2026 *)
PROG
(Python)
from sympy import primerange
def hamming_quadruples(limit):
primes = list(primerange(2, limit))
for p1, p2, p3, p4 in zip(primes, primes[1:], primes[2:], primes[3:]):
if (bin(p1 ^ p2).count('1') == 1 and
bin(p2 ^ p3).count('1') == 1 and
bin(p3 ^ p4).count('1') == 1):
print(p1, end=", ")
hamming_quadruples(500000)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Jens Ahlström, Jan 27 2026
STATUS
approved
