use table to lookup popcount for digit set

This is (much) faster on ARM than using the compiler builtin.