numDigit 0 base = 0 numDigit n base = 1 + numDigit (div n base) base
numDigit n base = ceiling (logBase base n) + 1