ArtsAutosBooksBusinessEducationEntertainmentFamilyFashionFoodGamesGenderHealthHolidaysHomeHubPagesPersonal FinancePetsPoliticsReligionSportsTechnologyTravel

How to Convert to Base-6

Updated on July 31, 2015
calculus-geometry profile image

TR Smith is a product designer and former teacher who uses math in her work every day.

The base-6 numbering system is also known as heximal or senary, and uses only the six digits 0, 1, 2, 3, 4 and 5 to represent numbers. Heximal has many interesting properties that are analogous to features of our usual base-10 numbering system. For example, like 10, the number 6 is also the product of two distinct primes. In base-6, any fraction whose denominator is of the form 2n3m can be expressed as a terminating decimal. This means 1/2, 1/3, 1/4, 1/6, 1/8, 1/9, 1/12, 1/16, 1/18, 1/24, 1/27, 1/32, etc., are all terminating decimals. The same is true of base-12, since 12 = 2*2*3. The parallel situation in base-10 is that all fractions whose denominators are of the form 2n5m have terminating decimal representations since 10 = 2*5.

In senary, all prime numbers end in 1 or 5, and all perfect numbers end in 44. (A perfect number is one whose proper factors add up to the number itself.) Square numbers never end in 2 or 5.

An easy way to generate random base-6 numbers with standard cubic dice, where the face numbered 6 represents 0. For example, if you roll three dice in succession and obtain 4, 6, 1, this represents the senary number 401, which is equivalent to the base-10 number 145.

To convert a number from base-10 to base-6, you can use the remainder algorithm. You can also convert the long way by expressing the number as the sum of multiples of powers of 6.


Converting to Base-6 with the Remainder Method

To apply the remainder method to a regular base-10 number, you begin by dividing it by 6, and noting the quotient and remainder. Next, you divide that quotient by 6 and again note the new quotient and new remainder. Proceed this way until you get a quotient of 0. Now take the list of remainders you generated and concatenate them from last to first. This is the base-6 representation of the number.

As an example, let's convert the base-10 number 79148 into a senary number. We start with simple division

79148÷6 = 13191 remainder 2

And now we repeat the process, this time dividing 13191 by 6 and noting the new quotients and remainders.

13191÷6 = 2198 remainder 3
2198÷6 = 366 remainder 2
366÷6 = 61 remainder 0
61÷6 = 10 remainder 1
10÷6 = 1 remainder 4
1÷6 = 0 remainder 1

Stringing together the remainders from last to first gives us the number 1410232. This is the base-6 representation of the base-10 number 79148.


How to Convert to a Sum of Multiples of 6^n

Another way to convert a base-10 number to a heximal number is to rewrite the number as the sum of multiples of powers of 6, where the multiples range from 0 to 5. The lowest power of 6 is 6^0 = 1 and the highest power is floor{log6(n)}. For example,

floor{ log6(79148) } = floor{ 6.295 } = 6, and

79148 = 1(6^6) + 4(6^5) + 1(6^4) + 0(6^3) + 2(6^2) + 3(6^1) + 2(6^0)

The coefficients or multiples are precisely the digits of the base-6 representation. Restricting the values of the multiples to {0, 1, 2, 3, 4, 5} ensures that the representation is unique. Thus, converting from one integer base to another is a one-to-one operation.


Fractions to Decimals in Base-6

Since 6 has a different prime factorization than 10, the representation of rational numbers by decimals (positional representation) is different. In base-10, fractions over 2, 4, 5, 8, 10, 16, 20, 25, etc., all terminate, but any fraction over a multiple of 3 turns into a repeating decimal. In base-6, fractions over multiples of 5 turn into repeating decimals, whereas denominators that are solely divisible by powers of 2 and/or 3 all terminate. Here is a sample of some rational numbers expressed as decimals in base-6.

Base-10 Fraction
Base-10 Decimal, with Repeating Part in {Braces}
Base-6 Decimal, with Repeating Part in {Braces}
1/2
0.5
0.3
1/3
0.{3}
0.2
2/3
0.{6}
0.4
1/4
0.25
0.13
3/4
0.75
0.43
1/5
0.2
0.{1}
2/5
0.4
0.{2}
3/5
0.6
0.{3}
4/5
0.8
0.{4}
1/6
0.1{6}
0.1
5/6
0.8{3}
0.5
1/7
0.{142857}
0.{05}
1/8
0.125
0.043
1/9
0.{1}
0.04
1/10
0.1
0.0{3}
1/11
0.{09}
0.{0313452421}
1/12
0.08{3}
0.03
1/13
0.{076923}
0.{024340531215}
1/14
0.0{714285}
0.0{23}
1/15
0.0{6}
0.0{2}
1/16
0.0625
0.0213

Other Base Conversion Tutorials

Number Theory in Base-6

Why do all prime numbers (except 2 and 3) have to end in either 1 or 5 in base-6? If a number in base-6 ends in 0, it is divisible by 6. If it ends in 2 or 4, it is divisible by 2. And if it ends in 3 it is divisible by 6. That leaves only 1 and 5 as the possible last digits of a prime number.

Why do all perfect numbers (except 6) end in "44" in base-6? If you recall, a perfect number is one whose proper factors add up to the number itself. All even perfect numbers P are of the form

P = [2^n]*[2^(n+1) - 1]

where 2^(n+1) - 1 is a prime number. It is not known if there exist any odd perfect numbers, as none have ever been found, and no proof of their non-existence has ever been devised. The base-10 representations of the first few perfect numbers are 6, 28, 496, 8128, and 33550336. All even perfect numbers except for 6 are of the form 36k + 28, meaning they are 28 plus a multiple of 36.

The base-6 representations of these numbers are 6, 44, 2144, 101344, and 3155033344. The fact that they all end in the digits 44 is a consequence of the fact that they are of the form 36k + 28, because if you reformulate that linear expression in base-6, it's 100k + 44.

Comments

    0 of 8192 characters used
    Post Comment

    • profile image

      P.N. 2 years ago

      We use disguised heximal code with 12 letters: B/D=1, C/G=2, F/E=3, H/A=4, K/R=5, U/V=0. Representation of numbers is unique in that if a digit occurs twice, it is represented with alternating letters for that digit.

    Click to Rate This Article