login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A294205 a(1) = 2; for n > 1, a(n) is the least prime p not already in the sequence such that the Hamming distance between p and a(n-1) is 1. 1
2, 3, 7, 5, 13, 29, 31, 23, 19, 17, 8209, 8273, 10321, 2129, 2113, 3137, 3169, 19553, 19489, 19457, 18433, 83969, 84481, 84737, 2181889, 2181953, 2706241, 2704193, 2687809, 590657, 590593, 590609, 590641, 590129, 524593, 274878431537, 274878431521, 274879480097, 1573153, 1573217, 1704289, 5898593 (list; graph; refs; listen; history; text; internal format)
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

Cf. A000040, A000079, A059459, A094076.

Sequence in context: A064011 A050367 A192175 * A059459 A124440 A067363

Adjacent sequences:  A294202 A294203 A294204 * A294206 A294207 A294208

KEYWORD

nonn,base

AUTHOR

Robert G. Wilson v, Oct 24 2017

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified October 14 17:31 EDT 2019. Contains 328022 sequences. (Running on oeis4.)