| Numeral systems by culture |
| Hindu-Arabic numerals |
Western Arabic
Eastern Arabic
Khmer |
Indian family
Brahmi
Thai |
| East Asian numerals |
Chinese
Suzhou
Counting rods |
Japanese
Korean
Mongolian |
| Alphabetic numerals |
Abjad
Armenian
Cyrillic
Ge'ez |
Hebrew
Greek (Ionian)
Aryabha?a
|
| Other systems |
Attic
Babylonian
Egyptian
English |
Etruscan
Mayan
Roman
Urnfield |
| List of numeral system topics |
| Positional systems by base |
| Decimal (10) |
| 2, 4, 8, 16, 32, 64 |
| 1, 3, 9, 12, 20, 24, 30, 36, 60, more… |
|
|
A Hexavigesimal numeral system has a base of twenty-six.
Base 26 is a fairly natural way of representing numbers as text using the 26-letter Latin alphabet. The number of interest is expressed in base 26, and then the 26 different base-26 digits 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 numbers 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.
public static String toBase26(int i){
String s="";
while(i>25){
int r=i%26;
i=i/26;
s=(char)(r+97)+s;
}
s=(char)(i+97)+s;
return s;
}
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:
for (int i=0; i < Math.Pow(26, depth); i++)
toBase26(i);
If you want to generate every possible combination of letters using the modification (i=i/26-1):
int numPatterns = 0;
for (int i = depth; i > 0; i--)
numPatterns += (int)Math.Pow(26, i);
for (int i = 0; i < numPatterns; i++)
toBase26(i);
| |