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”).

Binary XOR of prime divisors of n.
1

%I #42 Mar 11 2018 17:41:11

%S 2,3,2,5,1,7,2,3,7,11,1,13,5,6,2,17,1,19,7,4,9,23,1,5,15,3,5,29,4,31,

%T 2,8,19,2,1,37,17,14,7,41,6,43,9,6,21,47,1,7,7,18,15,53,1,14,5,16,31,

%U 59,4,61,29,4,2,8,10,67,19,20,0,71,1,73,39,6,17

%N Binary XOR of prime divisors of n.

%C The sequence of indices of zeros begins: 70, 140, 280, 350, 490, 560, 646, 700, 980, 1120, 1292, 1400, 1750, 1798, 1960, 2145.

%H Alois P. Heinz, <a href="/A293212/b293212.txt">Table of n, a(n) for n = 2..20000</a>

%F a(n)=n iff n is a prime.

%e a(6) = a(24) = 2 XOR 3 = 1.

%e a(2145) = 3 XOR 5 XOR 11 XOR 13 = 0.

%p a:= proc(n) local d, r; r:=0; for d in numtheory

%p [factorset](n) do r:= Bits[Xor](r, d) od; r

%p end:

%p seq(a(n), n=2..100); # _Alois P. Heinz_, Mar 09 2018

%o (PARI) a(n) = my(vp = factor(n)[,1]~, k=0); for (i=1, #vp, k = bitxor(k, vp[i])); k; \\ _Michel Marcus_, Feb 05 2018

%Y Cf. A000040, A072594, A178910.

%K nonn,base

%O 2,1

%A _Alex Ratushnyak_, Feb 04 2018