Denote a number as a sum of two in terms of the base

45 Views Asked by At

Technically, in decimal base,

$$445 = 44 \cdot 10 + 5.$$

Lets say there's a number of base $B$ where I want to segregate the number into last digit and rest of the first digit as a representation of sum like:

num = first_num*base + last_digit

Is it possible to write: $$665_7 = \text{first_number} \cdot \text{base} + \text{last_digit}? $$

Is it possible to denote to always obtain such representation?

2

There are 2 best solutions below

2
On

The form is the same: $$665_7 = 66_7 \times 10_7 + 5_7$$

Or generally, for bases $B$ where the number $665$ is valid ($B> 6$): $$665_B = 66_B \times 10_B + 5_B$$

This comes from the place notation: $$\begin{align*} 665_B &= 6\times 10_B^{2} + 6\times 10_B^1 + 5\times 10_B^0\\ &= (6\times 10_B + 6)\times 10_B^1 + 5\\ &= 66_B \times 10_B + 5_B \end{align*}$$

0
On

As long as the digits of the number are less than the base being used, a subscript should suffice. The digits have to be less than the base, because as in the above example with base 7, $7_10$ would equate to $10_7$ so there are only the digits 0-6 available for use in base 7.