bitsum :: Int -> Int
-- testing 8 combinations of argument values
-- pruning with 21/25 rules
-- looking through 3 candidates of size 1
-- looking through 3 candidates of size 2
-- looking through 5 candidates of size 3
-- looking through 10 candidates of size 4
-- looking through 26 candidates of size 5
-- looking through 68 candidates of size 6
-- looking through 182 candidates of size 7
-- tested 145 candidates
bitsum 0  =  0
bitsum x  =  bitsum (halve x) + parity x

bitsum :: Int -> Int
-- testing 8 combinations of argument values
-- pruning with 27/32 rules
-- looking through 4 candidates of size 1
-- looking through 2 candidates of size 2
-- looking through 17 candidates of size 3
-- looking through 16 candidates of size 4
-- looking through 246 candidates of size 5
-- looking through 239 candidates of size 6
-- looking through 4504 candidates of size 7
-- looking through 4542 candidates of size 8
-- looking through 89215 candidates of size 9
-- tested 10191 candidates
bitsum 0  =  0
bitsum x  =  bitsum (x `div` 2) + x `mod` 2