I am not a mathematician, but I do some computer programming and I am trying to find a solution to a fairly simple problem.
Is there any known formula/equation/function for mathematically determining the number of display digits (aka "places") that will be required when converting one number between two different number bases?
Example: Let us use the number 65535 (base 10) set as the variable N.
- N base 10 requires 5 decimal digits (N10 = 65535)
- N base 2 requires 16 binary digits (N02 = 1111111111111111)
- N base 16 requires 4 hexadecimal digits (N16 = FFFF)
I want to feed N base 10 (N10) and another base into a formula or subroutine of some sort which returns a single number. Using the above example it might look something like this:
- function(65535,2) returns 16
- function(65535,16) returns 4
I want to explore some fairly large numbers in several different number bases and I am hoping this can be done as pure math, even if it requires multiple steps, rather than some sort of indexed table that would have to be created for each base.
- Example: function(1222333444555,99) = ???
PS: Feel free to add any other appropriate tags since I am not sure what else would be right for this question.