|
|
A294994
|
|
Begin with 2; thereafter a(n) is the least prime not already in the sequence such that the Hamming distance between it and the preceding prime is at most 2.
|
|
5
|
|
|
2, 3, 5, 7, 11, 13, 29, 17, 19, 23, 31, 47, 37, 41, 43, 59, 61, 53, 101, 71, 67, 73, 79, 103, 97, 107, 109, 127, 191, 151, 131, 137, 139, 163, 167, 173, 157, 149, 181, 179, 211, 83, 89, 113, 241, 193, 197, 199, 223, 239, 227, 229, 233, 251, 379, 283, 271, 263, 257, 269, 277, 281, 313, 307, 311, 293
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
COMMENTS
|
The Hamming distance between two primes p and q is the Hamming distance between their binary expansions. - N. J. A. Sloane, May 27 2018
Conjecture: this sequence is a permutation of the primes.
|
|
LINKS
|
|
|
MATHEMATICA
|
f[s_List] := Block[{p = s[[-1]], q = 3}, While[MemberQ[s, q] || Plus @@ IntegerDigits [BitXor[p, q], 2] > 2, q = NextPrime@q]; Append[s, q]]; s = {2}; Nest[f, s, 65]
|
|
PROG
|
(PARI) s = 0; v = 2; for (n=1, 66, print1 (v ", "); s += 2^v; forprime (p=2, oo, if (!bittest(s, p) && hammingweight(bitxor(p, v))<=2, v = p; break))) \\ Rémy Sigrist, Jan 08 2018
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|