login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Numbers n such that prime(k) XOR prime(k+1) XOR ... XOR prime(n) = 0 for some k < n (where XOR denotes the binary XOR operator, and prime(n) = A000040(n)).
2

%I #25 Oct 23 2017 01:14:29

%S 17,28,30,33,36,43,45,47,51,52,56,58,65,66,72,74,76,80,84,90,94,107,

%T 111,119,126,129,130,133,137,143,145,155,156,166,169,174,179,185,192,

%U 200,202,204,208,213,214,216,219,228,238,246,248,249,250,254,258,262

%N Numbers n such that prime(k) XOR prime(k+1) XOR ... XOR prime(n) = 0 for some k < n (where XOR denotes the binary XOR operator, and prime(n) = A000040(n)).

%C Equivalently, numbers n such that A126084(n) = A126084(m) for some m < n.

%C See A293983(n) for the least k such that prime(k) XOR prime(k+1) XOR ... XOR prime(a(n)) = 0.

%H Robert Israel, <a href="/A293927/b293927.txt">Table of n, a(n) for n = 1..10000</a>

%e prime(33) XOR prime(34) XOR prime(35) XOR prime(36) = 137 XOR 139 XOR 149 XOR 151 = 0, hence 36 appears in the sequence.

%p N:= 1000: # to get all terms <= N

%p R[0]:= 0: T:= 2: p:= 2;

%p Res:= NULL:

%p for n from 2 to N do

%p p:= nextprime(p);

%p T:= Bits:-Xor(T,p);

%p if assigned(R[T]) then Res:= Res, n

%p else R[T]:= n

%p fi

%p od:

%p Res; # _Robert Israel_, Oct 22 2017

%o (PARI) s = 0; seen = 2^0; for (i = 1, 262, s = bitxor(s, prime(i)); if (bittest(seen, s), print1 (i ", "), seen += 2^s))

%Y Cf. A000040, A126084, A293983.

%K nonn,base

%O 1,1

%A _Rémy Sigrist_, Oct 21 2017