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!)
A283999 a(n) = A005187(n) XOR A006068(n), where XOR is bitwise-xor (A003987). 3

%I #16 May 08 2021 23:06:05

%S 0,0,0,6,0,14,14,14,0,30,30,30,30,30,18,16,0,62,62,62,62,62,50,48,62,

%T 62,34,32,34,32,44,44,0,126,126,126,126,126,114,112,126,126,98,96,98,

%U 96,108,108,126,126,66,64,66,64,76,76,66,64,92,92,92,92,92,82,0,254,254,254,254,254,242,240,254,254,226,224,226,224,236,236,254,254,194,192,194

%N a(n) = A005187(n) XOR A006068(n), where XOR is bitwise-xor (A003987).

%H Antti Karttunen, <a href="/A283999/b283999.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(n) = A005187(n) XOR A006068(n), where XOR is bitwise-xor (A003987).

%F a(n) = A006068(2*n) XOR A283997(2*n).

%t Table[BitXor[Fold[BitXor, n, Quotient[n, 2^Range[BitLength@ n - 1]]], 2 n - DigitCount[2 n, 2, 1]], {n, 0, 84}] (* _Michael De Vlieger_, Mar 20 2017, after _Jan Mangaldan_ at A006068 *)

%o (Scheme) (define (A283999 n) (A003987bi (A005187 n) (A006068 n))) ;; Where A003987bi implements bitwise-XOR (A003987).

%o (PARI) b(n) = if(n<1, 0, b(n\2) + n%2);

%o A(n) = 2*n - b(2*n);

%o a(n) = if(n<2, n, 2*a(floor(n/2)) + (n%2 + a(floor(n/2))%2)%2);

%o for(n=0, 110, print1(bitxor(A(n),a(n)),", ")) \\ _Indranil Ghosh_, Mar 25 2017

%o (Python)

%o def A(n): return 2*n - bin(2*n)[2:].count("1")

%o def a(n): return n if n<2 else 2*a(n//2) + (n%2 + a(n//2)%2)%2

%o print([A(n)^a(n) for n in range(111)]) # _Indranil Ghosh_, Mar 25 2017

%Y Cf. A003987, A005187, A006068, A283997.

%K nonn,base

%O 0,4

%A _Antti Karttunen_, Mar 20 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 19 19:02 EDT 2024. Contains 371798 sequences. (Running on oeis4.)