# Write down the lasgest base 5 positive integer in n digits and the largest base 7 number in m digits. it is necessary to represent n digits base 5 numbers in base 7. what is the minimum number m of...

Write down the lasgest base 5 positive integer in n digits and the largest base 7 number in m digits. it is necessary to represent n digits base 5 numbers in base 7. what is the minimum number m of digits needed to represent all possible n-digit base 5 numbers? hint the largest base 7 number should be greater than or equal to the largest n digit base 5 number.

anyone can explain this ?

*print*Print*list*Cite

### 1 Answer

We can write any number `a` in base `b` in this way:

`a=a_1a_2cdotsa_(n-1)a_n=a_1b^(n-1)+a_2b^(n-2)+cdots+a_(n-1)b+a_n`

where `a_1,a_2,ldots,a_n` are digits, that is numbers between 0 and `b-1`.

Now since 4 is the largest digit in base 5 the largest `n` digit number will be

`4cdot5^(n-1)+4cdot5^(n-2)+cdots+4cdot5+4`

Similarly the largest `m` digit number in base 7 will be

`6cdot7^(m-1)+6cdot7^(m-2)+cdots+6cdot7+6`

Now as you said to calculate the minimum number of digits in base 7 needed to represent any n digit number in base 5 the following must hold

`4cdot5^(n-1)+cdots+4cdot5+4 leq 6cdot7^(m-1)+cdots+6cdot7+6`

`4(5^(n-1)+5^(n-2)+cdots+5+1)leq6(7^(m-1)+7^(m-2)+cdots+7+1)`

In the brackets we have sum of first n and m terms of geometric series which we can calculate by using the following formula

`S_n=a_1cdot(r^n-1)/(r-1)`

where `a_1` is the first term (in our case 1) and `r` is the ratio (in our case 5 and 7).

`4cdot(5^n-1)/(5-1) leq 6cdot(7^m-1)/(7-1)`

`4cdot(5^n-1)/4 leq 6cdot(7^m-1)/6`

`5^n-1 leq 7^m-1`

`5^n leq 7^m`

`n log_7 5 leq m` **<-- Solution**

**So **`m` **must be greater than** `n log_7 5`.