A377404 In the binary expansion of n, replace the first, third, fifth, etc. 1's by 0's.
0, 0, 0, 1, 0, 1, 2, 2, 0, 1, 2, 2, 4, 4, 4, 5, 0, 1, 2, 2, 4, 4, 4, 5, 8, 8, 8, 9, 8, 9, 10, 10, 0, 1, 2, 2, 4, 4, 4, 5, 8, 8, 8, 9, 8, 9, 10, 10, 16, 16, 16, 17, 16, 17, 18, 18, 16, 17, 18, 18, 20, 20, 20, 21, 0, 1, 2, 2, 4, 4, 4, 5, 8, 8, 8, 9, 8, 9, 10, 10
Offset: 0
Examples
The first terms, in decimal and in binary, are: n a(n) bin(n) bin(a(n)) -- ---- ------ --------- 0 0 0 0 1 0 1 0 2 0 10 0 3 1 11 1 4 0 100 0 5 1 101 1 6 2 110 10 7 2 111 10 8 0 1000 0 9 1 1001 1 10 2 1010 10 11 2 1011 10 12 4 1100 100 13 4 1101 100 14 4 1110 100 15 5 1111 101
Links
Programs
-
PARI
a(n) = { my (b = binary(n), h = 0); for (i = 1, #b, if (b[i] && h++%2==1, b[i] = 0;);); fromdigits(b, 2); }
Comments