login
A377404
In the binary expansion of n, replace the first, third, fifth, etc. 1's by 0's.
1
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,7
COMMENTS
Each 1 in the binary expansion of n appears either in a(n) or in A265263(n).
FORMULA
a(n) = n - A265263(n).
a(2*n) = 2*a(n).
A000120(a(n)) = floor(A000120(n)/2).
EXAMPLE
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
PROG
(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); }
CROSSREFS
Sequence in context: A363623 A376630 A101565 * A292944 A327188 A330270
KEYWORD
nonn,base,easy
AUTHOR
Rémy Sigrist, Oct 28 2024
STATUS
approved