Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

For instance, the number $1000$ takes $4$ digits in base $10$, $10$ digits in base $2$, $3$ digits in base $20$, and $2$ digits in base $1000$.

What is the mathematical relationship between number of digits and base?

share|improve this question
1  
The Logarithm! –  k.stm Mar 19 '13 at 19:38

3 Answers 3

up vote 3 down vote accepted

Let $n$ be a positive integer. The base $b$ representation of $n$ has $d$ digits if $b^{d-1}\le n<b^d$, which is the case if $d-1\le\log_b n<d$, or $\lfloor\log_bn\rfloor=d-1$. The number of digits in the base $b$ representation of $n$ is therefore

$$\lfloor\log_bn\rfloor+1=\left\lfloor\frac{\ln n}{\ln b}\right\rfloor+1\;.$$

When $n$ is large compared with $b$, it’s roughly inversely proportional to $\ln b$.

share|improve this answer

$N$ in base $10$ has $\lfloor\log_mN\rfloor+1$ digits in base $m$.

share|improve this answer

If $$10^n \le x < 10^{n+1},$$ then $x$ has $n+1$ digits in base $10$ and $$ 4^{n\log_4 10} \le x < 4^{(n+1)\log_4 10} $$ Find out which integers $n\log_{10}4$ is between and which integers $(n+1)\log_{10}4$ is between. That will tell you something about the number of digits that $x$ has in base $4$.

Multiplying the number of base-$10$ digits by $\log_4 10$ gives you the approximate number of base-$4$ digits.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.