Library/Arithmetic/Base Numbers Problems

Base Numbers Problems

Practice
Overview
Important

A number in base-bb is written as a sequence of digits dndn1d1d0d_n d_{n-1} \ldots d_1 d_0, where each did_i is an integer from 00 to b1b-1. The value of the number is:

dn×bn+dn1×bn1++d1×b1+d0×b0d_n \times b^n + d_{n-1} \times b^{n-1} + \cdots + d_1 \times b^1 + d_0 \times b^0

Base number problems often involve converting numbers between bases, performing arithmetic in different bases, or interpreting numbers written in unfamiliar bases.

Important properties

  • Each digit in base-bb must be less than bb.

  • The rightmost digit is the 'ones' place (b0b^0), the next is b1b^1, and so on.

  • To convert from base-bb to base-10, expand using powers of bb.

  • To convert from base-10 to base-bb, repeatedly divide by bb and record remainders.