login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A283977 a(2n) = A002487(n), a(2n+1) = A002487(n) XOR A002487(n+1), where XOR is bitwise-xor (A003987). 4

%I #11 Mar 23 2017 11:44:04

%S 0,1,1,0,1,3,2,3,1,2,3,1,2,1,3,2,1,5,4,7,3,6,5,7,2,7,5,6,3,7,4,5,1,4,

%T 5,1,4,3,7,4,3,11,8,13,5,2,7,5,2,5,7,2,5,13,8,11,3,4,7,3,4,1,5,4,1,7,

%U 6,3,5,12,9,13,4,15,11,12,7,13,10,9,3,8,11,3,8,5,13,8,5,9,12,11,7,14,9,11,2,11,9,14,7,11,12,9,5,8,13,5,8,3,11,8,3

%N a(2n) = A002487(n), a(2n+1) = A002487(n) XOR A002487(n+1), where XOR is bitwise-xor (A003987).

%H Antti Karttunen, <a href="/A283977/b283977.txt">Table of n, a(n) for n = 0..8192</a>

%H <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a>

%F a(2n) = A002487(2n) = A002487(n), a(2n+1) = A002487(n) XOR A002487(n+1), where XOR is bitwise-xor (A003987).

%F a(n) = A283976(n) - A283978(n).

%F a(n) = A002487(n) - 2*A283978(n).

%t a[0] = 0; a[1] = 1; a[n_] := If[EvenQ@ n, a[n/2], a[(n - 1)/2] + a[(n + 1)/2]]; Table[If[EvenQ@ n, a[n/2], BitXor[a[#], a[# + 1]] &[(n - 1)/2]], {n, 0, 112}] (* _Michael De Vlieger_, Mar 22 2017 *)

%o (Scheme) (define (A283977 n) (if (even? n) (A002487 n) (A003987bi (A002487 (/ (- n 1) 2)) (A002487 (/ (+ n 1) 2))))) ;; Where A003987bi implements bitwise-XOR (A003987).

%o (PARI) A(n) = if(n<2, n, if(n%2, A(n\2) + A((n + 1)/2), A(n/2)));

%o a(n) = if(n<2, n, if(n%2, bitxor(A(n\2), A((n + 1)/2)), A(n\2)));

%o for(n=0, 120, print1(a(n), ", ")) \\ _Indranil Ghosh_, Mar 23 2017

%Y Bisections: A002487, A283987.

%Y Cf. A003987, A283976, A283978.

%K nonn,base

%O 0,6

%A _Antti Karttunen_, Mar 21 2017

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 17 23:23 EDT 2024. Contains 371767 sequences. (Running on oeis4.)