login
A174203
In the sequence A007088 of binary representations of n, delete the 1st, 3rd, 5th, 7th, 9th etc occurrence of 0 and 1. Rewrite the bits left over in base 10.
7
2, 1, 0, 1, 2, 3, 0, 2, 2, 5, 2, 1, 6, 3, 0, 2, 4, 5, 2, 1, 5, 3, 2, 2, 5, 5, 2, 3, 6, 7, 0, 4, 4, 9, 2, 1, 10, 3, 4, 2, 10, 5, 2, 5, 5, 11, 4, 2, 10, 5, 2, 5, 5, 11, 2, 6, 6, 13, 6, 3, 14, 7, 0, 4, 8, 9, 2, 1, 9, 3, 2, 2, 9, 5, 2, 5, 10, 11, 4
OFFSET
0,1
COMMENTS
Deleting the odd occurrences of 0 and the even occurrences of 1, we get the same sequence apart from the initial 2 replaced by 1 and 0.
EXAMPLE
Numbers in base 2: 0, 1, 10, 11, 100, 101, 110, 111, 1000, .... Delete odd occurrences of 0 (replaced by ~): ~, 1, 10, 11, 1~0, 1~1, 110, 111, 1~0~ Delete odd occurrences of 1 (replaced by ~): ~, ~, 10, ~1, ~~0, 1~~, 1~0, 1~1, ~~0~.
The pieces left are 10, 1, 0, 1, 10, 11, 0, ... which is in base 10: 2, 1, 0, 1, 2, 3, 0, ....
MAPLE
n1 := 1 ; n0 := 1 ;
for n from 0 to 80 do
if n = 0 then b := [0] ; else b := convert(n, base, 2) ; end if;
for d from nops(b) to 1 by -1 do
if op(d, b) = 0 then
if type(n0, 'odd') then b := subsop(d=NULL, b) ; end if; n0 := n0+1 ;
else
if type(n1, 'odd') then b := subsop(d=NULL, b) ; end if; n1 := n1+1 ;
end if;
end do:
add(2^(i-1)*op(i, b), i=1..nops(b)) ; printf("%d, ", %) ;
end do: # R. J. Mathar, Nov 23 2010
KEYWORD
easy,nonn,base,less
AUTHOR
EXTENSIONS
Sequence extended, keyword:base,less added by R. J. Mathar, Nov 23 2010
STATUS
approved