Module utils
Calculates the k-adicity of n, i.e., the number of trailing 0s in a base-k representation.