login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo

Thanks to everyone who made a donation during our annual appeal!
To see the list of donors, or make a donation, see the OEIS Foundation home page.

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A283998 a(n) = n AND A005187(floor(n/2)), where AND is bitwise-and (A004198). 3
0, 0, 0, 1, 0, 1, 4, 4, 0, 1, 8, 8, 8, 8, 10, 11, 0, 1, 16, 16, 16, 16, 18, 19, 16, 16, 18, 19, 24, 25, 26, 26, 0, 1, 32, 32, 32, 32, 34, 35, 32, 32, 34, 35, 40, 41, 42, 42, 32, 32, 34, 35, 48, 49, 50, 50, 48, 49, 50, 50, 56, 56, 56, 57, 0, 1, 64, 64, 64, 64, 66, 67, 64, 64, 66, 67, 72, 73, 74, 74, 64, 64, 66, 67, 80, 81, 82, 82, 80, 81, 82, 82, 88, 88, 88, 89 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,7

LINKS

Antti Karttunen, Table of n, a(n) for n = 0..8192

Index entries for sequences related to binary expansion of n

FORMULA

a(n) = n AND A005187(floor(n/2)), where AND is bitwise-and (A004198).

a(n) = A283996(n) - A283997(n).

a(n) = A005187(n) - A283996(n) = (A005187(n) - A283997(n))/2.

MATHEMATICA

A[n_]:=2*n - DigitCount[2*n, 2, 1]; Table[BitAnd[n, A[Floor[n/2]]], {n, 0, 100}] (* Indranil Ghosh, Mar 25 2017 *)

PROG

(Scheme) (define (A283998 n) (A004198bi n (A005187 (floor->exact (/ n 2))))) ;; Where A004198bi implements bitwise-AND (A004198).

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

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

for(n=0, 100, print1(bitand(n, A(floor(n/2))), ", ")) \\ Indranil Ghosh, Mar 25 2017

(Python)

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

print [n&A(n/2) for n in range(0, 101)] # Indranil Ghosh, Mar 25 2017

CROSSREFS

Cf. A004198, A005187, A283996, A283997.

Sequence in context: A067007 A066298 A108068 * A318143 A131124 A131125

Adjacent sequences:  A283995 A283996 A283997 * A283999 A284000 A284001

KEYWORD

nonn,base

AUTHOR

Antti Karttunen, Mar 19 2017

STATUS

approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified January 22 22:16 EST 2020. Contains 331166 sequences. (Running on oeis4.)