Finding a sequence of numbers writen to any base

348 Views Asked by At

In a number system written to any base, how can i generate numbers in that system? For example, how can i find the first 20 numbers in a number system which has a base 7?.

1

There are 1 best solutions below

0
On

There is a little bit of awkward vocabulary you are using. That is, you are refering to "numbers in a number system", which sort of sounds like you think that a number in one number system is different from a number in another number system. This is not true. What is different system to system is the symbols we use to represent numbers.

Let me explain.

There is only one answer to "What are the first 10 natural numbers". That answer is a set of $10$ elements of $\mathbb N$. They are the number $1$, the successor of number $1$, the successor of that number, the successor of that one, and so on, up to the successor of the successor of the successor of the successor of the successor of the successor of the successor of the successor of the successor of of 1 (there are 9 successors written, in case you count).

Now, how we represent those 10 numbers is a different story. Represented in base $10$, we represent them with the symbols $1,2,3,4,5,6,7,8,9,10$. However, any number we represent in base $10$, we can also represent in any other base. For example, in base $7$, we represent the number, represented by the symbol $9$ in base $10$, with the symbol $12$, because $1\cdot 7^1 + 2\cdot 7^0=9$.


So, to answer your question more exactly, the first $20$ numbers, represented in base $7$ are $$1,2,3,4,5,6,10,11,12,13,14,15,16,20,21,22,23,24,25$$