A048735 a(n) = (n AND floor(n/2)), where AND is bitwise and-operator (A004198).
0, 0, 0, 1, 0, 0, 2, 3, 0, 0, 0, 1, 4, 4, 6, 7, 0, 0, 0, 1, 0, 0, 2, 3, 8, 8, 8, 9, 12, 12, 14, 15, 0, 0, 0, 1, 0, 0, 2, 3, 0, 0, 0, 1, 4, 4, 6, 7, 16, 16, 16, 17, 16, 16, 18, 19, 24, 24, 24, 25, 28, 28, 30, 31, 0, 0, 0, 1, 0, 0, 2, 3, 0, 0, 0, 1, 4, 4, 6, 7, 0
Offset: 0
Links
- T. D. Noe, Table of n, a(n) for n = 0..1023
- Beeler, M., Gosper, R. W. and Schroeppel, R., HAKMEM, ITEM 23 (Schroeppel)
Programs
-
Maple
seq(Bits:-And(n,floor(n/2)), n=0..200); # Robert Israel, Feb 29 2016
-
Mathematica
Table[BitAnd[n, Floor[n/2]], {n, 0, 127}] (* T. D. Noe, Aug 13 2012 *)
-
PARI
a(n) = bitand(n, n\2); \\ Michel Marcus, Feb 29 2016
-
Python
def a(n): return n&int(n/2) # Indranil Ghosh, Jun 13 2017
Formula
a(n) = A048728(n)/4. (This was the original definition. AND-formula found Jan 01 2007).
Extensions
New formula and more terms added by Antti Karttunen, Jan 01 2007
Comments