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

A283979
a(n) = (n XOR A264977(n))/4, where XOR is bitwise-xor (A003987).
1
0, 0, 0, 0, 0, 1, 0, 0, 0, 3, 2, 3, 0, 3, 0, 0, 0, 7, 6, 5, 4, 4, 6, 7, 0, 5, 6, 5, 0, 7, 0, 0, 0, 15, 14, 9, 12, 10, 10, 9, 8, 10, 8, 8, 12, 10, 14, 15, 0, 9, 10, 15, 12, 14, 10, 9, 0, 9, 14, 9, 0, 15, 0, 0, 0, 31, 30, 17, 28, 22, 18, 21, 24, 20, 20, 18, 20, 16, 18, 17, 16, 22, 20, 22, 16, 21, 16, 16, 24, 16, 20, 18, 28, 22, 30, 31, 0, 17, 18, 27, 20, 28, 30
OFFSET
0,10
FORMULA
a(n) = (n XOR A264977(n))/4, where XOR is bitwise-xor (A003987).
MATHEMATICA
A264977[n_]:= If[n<2, n, If[EvenQ[n], 2 A264977[n/2], BitXor[A264977[(n - 1)/2], A264977[(n + 1)/2]]]]; Table[BitXor[n, A264977[n]]/4, {n, 0, 100}] (* Indranil Ghosh, Mar 28 2017 *)
PROG
(Scheme) (define (A283979 n) (/ (A003987bi n (A264977 n)) 4)) ;; Where A003987bi implements bitwise-xor (A003987).
(PARI) a(n) = if(n<2, n, if(n%2, bitxor(a((n - 1)/2), a((n + 1)/2)), 2*a(n/2)));
for(n=0, 150, print1(bitxor(n, a(n))/4, ", ")) \\ Indranil Ghosh, Mar 28 2017
CROSSREFS
KEYWORD
nonn,base,look
AUTHOR
Antti Karttunen, Mar 25 2017
STATUS
approved