perl -e "print eval join '+',grep{((scalar @{[((sprintf '%b',$_)=~/1/g)]}))%2==0} 0..$ARGV[0];" 10 33