- Hexavigesimal
A Hexavigesimal
numeral system has a base oftwenty-six .Base 26 is a fairly natural way of representing numbers as text using the 26-letter
Latin alphabet . Thenumber of interest is expressed in base 26, and then the 26 different base-26digits are identified with letters as 0=A, 1=B, 2=C, ... 25=Z. Some examples: 26 = BA, 678 = BAC.This system is of limited practical value, although letters used in nominal or
serial number s can be thought as hexavigesimal numerals for calculation purposes if the entire alphabet is used.Fractions
The fact that 26 is a
composite number and lies between two composite numbers (25 and 27) leads to many simple fractions.B/C = A.N B/D = A.IRIRIRIR... B/E = A.GN B/F = A.FFFFFFF...
The fractions B/G, B/I, B/J, B/K, B/M, B/N, B/P, B/Q are also simple.
Example Encoding Algorithm
This Java implementation shows how to convert base10 to base26. For the sake of simplicity "StringBuffer" or "StringBuilder" wasn't used. 97 is a magic number which refers to the
ASCII code of the letter 'a' . Note that you can actually replace the 97 with 'a' in Java. However, it's not that easy with every language, hence the magic number, which should make porting a bit easier.This code generates a, b, c, d, e ... z, then ba, bb, bc ... bz ... za, za, zb, zc ... zz, then baa, bab, etc. Since a is equal to 0, aaab, is the same as b. If you want the code to generate a, b, c ... z, then aa, ab, ac you need to subtract 1 from i=i/26.If you want to generate every possible combination of letters with the above algorithm:
If you want to generate every possible combination of letters using the modification (i=i/26-1):
Wikimedia Foundation. 2010.