Saturday, May 9, 2015

Decimal to octal and duodecimal




We multiply the numbers of each diagonal of the table ( the red and yellow series of numbers, bottom left to top right) one by one with each of the digits of the decimal number to be converted (the blue digits in the leftmost column up to the bar) starting from the bottom in both cases and moving upwards, so we multiply 5 by 1, 9 by 2, 6 by 4 etc. up to 4 times 128 and we add the products. We then remove the greatest multiple of 8 less than the sum from the sum and keep the remainder as a digit (the last first) of the octal number to be found. We keep how many times 8 goes into the sum we found as the carry for the next addition of products. Then we begin at the next blue digit from the end in the leftmost column (9 in this case) and we multiply up to the beginning of the blue digits each digit with each of the numbers of the next diagonal (a red square one in this case) and again we make the sum of the products, convert it as before, add the carry from the previous addition if needed  and convert again if necessary and we get the next digit (from the end) of the octal number to be found. We move along in this way, until only one of the blue digits (4 in this case) is multiplied by 1. The octal number might have more digits from the decimal number because of the carry. The coefficients (numbers in yellow or red squares) always stay the same and we can add more rows to the top one, taking into account that each row starts with 1 and the next number is the sum of twice the number below it and to the left plus the number immediately below it (so 672 in the top row is twice 240 plus 192, 448 is twice 192 plus 64, and 128 is just twice 64 because there is no number immediately below it). Every decimal number can be converted to octal thanks to this table. To convert a decimal number to a base-12 number we use the same table and the same process only that in every second number (second, fourth, sixth etc.) of a diagonal we attach a negative sign. If the sum we end up getting from multiplication with the numbers of a diagonal is now negative, we keep adding multiples of twelve until it turns out positive and we subtract the number of multiples we added from the next sum, once that is complete. The base-12 number can also have 10 and 11 as digits, so to avoid confusion we can also denote them as A and B. The base-12 number can have less digits than the decimal number. By converting to octal we can add the digits of the octal number as if they were decimals and divide the sum by 7 (normal, decimal division). It's casting out 7's, it's the same as casting out 9's. The remainder of the division would be the remainder of the decimal number we started with when that number is divided by 7. On the other hand, we can add pairs of digits of the base-12 number starting from the end as if they were two-digit base-12 numbers (base-12 addition). If the number of the digits is odd we will only add one digit at the end. Repeating the process in the base-12 sum that we got and keeping it up until we get a two-digit base-12 number we calculate its difference from the next lesser base-12 number with the same two digits (the difference could well be ten, eleven or twelve - we need to make a base-12 subtraction). That difference is the remainder of the decimal number we started with when divided by thirteen. The numbers on each row of the table starting from the left row from the bottom give the number of features (vertices, edges, faces, spaces etc.) of rectangular figures (square, cube, hypercube and their analogues in higher dimensions).

No comments: