# $n\le 20$ What is the maximum number of digits representing $n$ with base $4$?

$n\le 20$. What is the maximum number of digits representing $n$ with base $4$?

This is a question on a sample test that I'm studying for. My prof hasn't gone over it in class, can someone direct me or help me with the procedure to this question?

So to write 20 in base 4 notation would mean (thanks to nikita2) $20=16+4=4^2+4^1=1⋅4^2+1⋅4^1+0⋅4^0$

-
I’ve taken care of it this time, but you should always make the body of the question self-contained: the reader shouldn’t have to refer to the title for crucial information. –  Brian M. Scott Oct 31 '12 at 1:10
Can you write the number 20 in base 4 and see how many digits it requires? –  MJD Oct 31 '12 at 1:10
@BrianM.Scott Thanks for the advice, I will for sure. –  Unknown Oct 31 '12 at 1:11
@MJD I've edited the question, I believe I've done it correctly, I don't know what base means. –  Unknown Oct 31 '12 at 1:14
If you don't know what base means, wouldn't it make sense to look back in your notes or in the textbook to see if you could find out before you try to answer the question? –  MJD Oct 31 '12 at 1:16

If $n=20$,

$20=16+4 = 4^2 + 4^1= 1\cdot4^2 + 1\cdot4^1 + 0\cdot4^0$

So $20 \sim 110$, and maximum number is $3$.

-
Could you possibly extend this answer? I'm unfamiliar with base notation. –  Unknown Oct 31 '12 at 1:22
In our life we use base $10$. It means that every number is $a\cdot10^0+b\cdot10^1+c\cdot10^2$ ... and it is ...cba. For example $396 = 6\cdot10^0 + 9\cdot10^1 + 3\cdot10^2$. Ok MJD did it better. –  Nikita Evseev Oct 31 '12 at 1:29

To write an integer $n$ "in base $b$ notation" means to represent it in the form

$$d_i\cdot b^i + d_{i-1}\cdot b^{i-1} + \cdots + d_0 \cdot b^0$$

where each $d_i$ is an integer less than $b$ and at least 0, except that the first $d_i$ may not be 0. There is guaranteed to be exactly one way to do this. Then we say that the $d_i$ are the "base-$b$ digits of the number $n$".

For example, to write the integer 237 in base 10, we write

\begin{align} 237 & = 2\cdot 10^2 + 3\cdot 10^1 + 7\cdot 10^0 \\ & = 2\cdot 100 + 3\cdot 10 + 7\cdot 1 \\ & = 200 + 30 + 7\\ & = 237 \end{align}

and the "base-10 digits of 237" are 2, 3, and 7, as you expect. But we can also ask about the base-8 digits of 237:

\begin{align} 237 & = 3\cdot 8^2 + 5\cdot 8^1 + 5\cdot 8^0 \\ & = 3\cdot 64 + 5\cdot 8 + 5\cdot 1 \\ & = 192 + 40 + 5 \\ & = 237 \end{align}

so that "base-8 digits of 237" are 355; we sometimes write that "$237 = 355_8$".

Or the base-2 digits of 237:

\begin{align} 237 & = 1\cdot 2^7 + 1\cdot 2^6 + 1\cdot 2^5 + 0\cdot 2^4 + 1\cdot 2^3 + 1\cdot 2^2 + 0\cdot 2^1 + 1\cdot 2^0 \\ & = 1\cdot 128 + 1\cdot 64 + 1\cdot 32 + 0\cdot 16 + 1\cdot 8 + 1\cdot 4 + 0\cdot 2 + 1\cdot 1 \\ & = 128 + 64 + 32 + 0 + 8 + 4 + 0 + 1 \\ & = 237 \end{align}

So the base-2 digits of the number 237 are 11101101; the number requires 8 digits to write in base 2. Notice that because we are writing base-2, the digits must never be bigger than 1, just as in base 10, the conventional system, digits are never bigger than 9.

A larger number never has a shorter base-$b$ representation than a smaller number, so of the numbers from 1 to 20, you need the most digits to write 20 in any base. If you can find how many digits are needed to write 20 in base 4, you have the answer to your question.

Can you make any progress from here?

-
Sorry, I went out, this is very helpful and thank you for taking the time to answer my questions. It makes sense. –  Unknown Oct 31 '12 at 3:18
Yeah, after some more calculation, this does help a lot. –  Unknown Oct 31 '12 at 3:22
Are some base calculations impossible? For example finding the base 5 digits of 20? –  Unknown Oct 31 '12 at 3:26
No, the base-5 digits of 20 are 40 because $20 = 4\cdot5^1 + 0\cdot 5^0$. For any positive $n$ and any base $b\ge 2$, there is always exactly one set of base-$b$ digits of $n$. –  MJD Oct 31 '12 at 3:33
Of course, thanks. –  Unknown Oct 31 '12 at 3:39