OFFSET
1,1
COMMENTS
Conjecture: this sequence is infinite.
First differs from A059459 at a(15).
By definition of a Hamming distance of 1, the first forward absolute difference between a(n-1) and a(n) is a power of two (A000079).
The exponent of two in those differences is 0, 2, 1, 3, 4, 1, 3, 2, 1, 13, 6, 11, 13, 4, 10, 5, 14, 6, 5, 10, 16, 9, 8, 21, 6, 19, 11, 14, 21, 6, 4, 5, 9, 16, 38, 4, 20, 38, 6, 17, 22, 20, 14, 22, 10, 14, 2, 10, 46, 1, 28, 3, 56, 75, 3, 8, 16, 27, 75, 3, 20, 25, 606, 807, 2052, 2177, 886, 759, 796, 5357, 966, 399, etc.
Note that it is not true that for every prime m there is some k such that m+2^k is prime: see comments and links at A094076. Thus it is quite conceivable that the sequence is finite. - Robert Israel, Nov 15 2017
LINKS
Robert G. Wilson v, Table of n, a(n) for n = 1..70
MAPLE
A[1]:= 2: S:= {2}:
L:= [1]:
for n from 2 to 50 do
found:= false;
for i from 1 to nops(L) while not found do
cand:= A[n-1] - 2^L[-i];
if not member(cand, S) and isprime(cand) then
found:= true; L:= subsop(-i=NULL, L) fi;
od;
for k from 0 while not found do
if not member(k, L) then
cand:= A[n-1] + 2^k;
if not member(cand, S) and isprime(cand) then
found:= true; L:= sort([op(L), k]);
fi
fi
od;
A[n]:= cand;
S:= S union {cand};
od:
seq(A[i], i=1..50); # Robert Israel, Nov 15 2017
MATHEMATICA
hammingDistance[a_, b_] := Count[ IntegerDigits[ BitXor[a, b], 2], 1]; f[s_List] := Block[{p = s[[-1]], q = 3}, While[MemberQ[s, q] || hammingDistance[p, q] > 1, q = NextPrime@q]; Append[s, q]]; s = {2}; Nest[f, s, 26] (* or *)
f[s_List] := Block[{k = -Floor[RealExponent[s[[-1]], 2]], p = s[[-1]]}, While[q = If[k < 0, p - 2^-k, p + 2^k]; MemberQ[s, q] || !PrimeQ[q] || hammingDistance[p, q] > 1, k++]; Append[s, q]]; s = {2}; Nest[f, s, 67]
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Robert G. Wilson v, Oct 24 2017
STATUS
approved