Given an X, what math is needed to find its Y, using this table?
x | y |
---|---|
0 | 1 |
1 | 0 |
2 | 6 |
3 | 5 |
4 | 4 |
5 | 3 |
6 | 2 |
This is a language agnostic problem. I can't just store the array, and do the lookup. The input will always be the finite set of 0 to 6. It won't be scaling later.
Step 1 − Divide the decimal number to be converted by the value of the new base. Step 2 − Get the remainder from Step 1 as the rightmost digit (least significant digit) of new base number. Step 3 − Divide the quotient of the previous divide by the new base.
Number system conversions deal with the operations to change the base of the numbers. For example, to change a decimal number with base 10 to binary number with base 2. We can also perform the arithmetic operations like addition, subtraction, multiplication on the number system.
In number system, base 9 number system is also called Nonary system. In this system, each digit is written as two ternary (base 3) digits. Unlike how octal (base 8) and hexadecimal (base 16) systems are used in place of binary (base 2), base 9 number system can be used to compact representation of ternary.
The undecimal numeral system (also known as the base-11 numeral system) is a positional numeral system that uses eleven as its base.
This:
y = (8 - x) % 7
This is how I arrived at that:
x 8-x (8-x)%7
----------------
0 8 1
1 7 0
2 6 6
3 5 5
4 4 4
5 3 3
6 2 2
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With