If, in a number system, 40132 corresponds to 2542 in decimals, find the base of the number system.
Answers
An efficient approach : It resides on the relationship between the base of the number and number of digits of that number.
Typically : Let n be a positive integer. The base
b representation of
n has
d digits if
b^{d-1}\leq n < b^d, which is the case if
d-1 \leq \log_b n < d or
\lfloor log_b n \rfloor = d-1 .The number of digits in the base b representation of n is therefore
\lfloor log_b N \rfloor + 1 = \left \lfloor \dfrac {ln N}{ln b} \right \rfloor + 1 = \left \lfloor \dfrac {log N}{log b} \right \rfloor + 1
In above equation the base changing logarithmic property has been used. So we calculate the logarithm of the number in that base which we want to calculate the number of digits. And take its ceiling and then add 1.
This idea can be further used to find the number of digits of a given number n of base b in base r. All have to be done is to convert the number in base 10 and then apply the above formula of finding digits. It would be easier to calculate log of any base when number is in base 10.