# Mixed radix

Part of a series on :
Numeral systems :
Place-value notation
Hindu–Arabic numerals
Western Arabic
Eastern Arabic
Bengali
Devanagari
Gujarati
Gurmukhi
Odia
Sinhala
Tamil
Malayalam
Telugu
Kannada
Dzongkha
Tibetan
Balinese
Burmese
Javanese
Khmer
Lao
Mongolian
Sundanese
Thai
East Asian systems
Contemporary
Chinese
Hokkien
Suzhou
Japanese
Korean
Vietnamese
Historic
Counting rods
Tangut
Other systems
History
Ancient
Babylonian
Post-classical
Cistercian
Mayan
Muisca
Pentadic
Quipu
Rumi
Contemporary
Cherokee
Kaktovik (Iñupiaq)
By radix/base
Common radices/bases
2
3
4
5
6
8
10
12
16
20
60
Non-standard radices/bases
Bijective (1)
Signed-digit (balanced ternary)
Mixed (factorial)
Negative
Complex (2i)
Non-integer (φ)
Asymmetric :
Sign-value notation
Non-alphabetic
Aegean
Attic
Aztec
Brahmi
Chuvash
Egyptian
Etruscan
Kharosthi
Prehistoric counting
Proto-cuneiform
Roman
Tally marks
Alphabetic
Abjad
Armenian
Alphasyllabic
Akṣarapallī
Āryabhaṭa
Kaṭapayādi
Coptic
Cyrillic
Geʽez
Georgian
Glagolitic
Greek
Hebrew :
List of numeral systems :
vte :
Mixed radix numeral systems are non-standard positional numeral systems in which the numerical base varies from position to position. Such numerical representation applies when a quantity is expressed using a sequence of units that are each a multiple of the next smaller one, but not by the same factor. Such units are common for instance in measuring time; a time of 32 weeks, 5 days, 7 hours, 45 minutes, 15 seconds, and 500 milliseconds might be expressed as a number of minutes in mixed-radix notation as:
or as
    32$_∞$5$_7$07$_{24}$45$_{60}$.15$_{60}$500$_{1000}$
In the tabular format, the digits are written above their base, and a semicolon indicates the radix point. In numeral format, each digit has its associated base attached as a subscript, and the radix point is marked by a full stop or period. The base for each digit is the number of corresponding units that make up the next larger unit. As a consequence there is no base (written as ∞) for the first (most significant) digit, since here the "next larger unit" does not exist (and one could not add a larger unit of "month" or "year" to the sequence of units, as they are not integer multiples of "week").

## Examples

The most familiar example of mixed-radix systems is in timekeeping and calendars. Western time radices include, both cardinally and ordinally, decimal years, decades, and centuries, septenary for days in a week, duodecimal months in a year, bases 28–31 for days within a month, as well as base 52 for weeks in a year. Time is further divided into hours counted in base 24 hours, sexagesimal minutes within an hour and seconds within a minute, with decimal fractions of the latter.
A standard form for dates is 2021-04-10 16:31:15, which would be a mixed radix number by this definition, with the consideration that the quantities of days vary both per month, and with leap years. One proposed calendar instead uses base 13 months, quaternary weeks, and septenary days.
A mixed radix numeral system is often best expressed with a table. A table describing what can be understood as the 604800 seconds of a week is as follows, with the week beginning on hour 0 of day 0 (midnight on Sunday):
| Radix | 7 | 24 | 60 | 60 |
| Denomination | day | hour | minute | second |
| Place value (seconds) | 86400 | 3600 | 60 | 1 |
In this numeral system, the mixed radix numeral 3$_7$17$_{24}$51$_{60}$57$_{60}$ seconds would be interpreted as 17:51:57 on Wednesday, and 0$_7$0$_{24}$02$_{60}$24$_{60}$ would be 00:02:24 on Sunday. Ad hoc notations for mixed radix numeral systems are commonplace.
The Maya calendar consists of several overlapping cycles of different radices. A short count tzolk'in overlaps base 20 named days with tridecimal numbered days. A haab' consists of vigesimal days, octodecimal months, and base-52 years forming a round. In addition, a long count of vigesimal days, octodecimal winal, then base 24 tun, k'atun, b'ak'tun, etc., tracks historical dates.
A second example of a mixed-radix numeral system in current use is in the design and use of currency, where a limited set of denominations are printed or minted with the objective of being able to represent any monetary quantity; the amount of money is then represented by the number of coins or banknotes of each denomination. When deciding which denominations to create (and hence which radices to mix), a compromise is aimed for between a minimal number of different denominations, and a minimal number of individual pieces of coinage required to represent typical quantities. So, for example, in the UK, banknotes are printed for £50, £20, £10 and £5, and coins are minted for £2, £1, 50p, 20p, 10p, 5p, 2p and 1p—these follow the 1-2-5 series of preferred values.
Prior to decimalisation, monetary amounts in the UK were described in terms of pounds, shillings, and pence, with 12 pence per shilling and 20 shillings per pound, so that "£1 7s 6d", for example, corresponded to the mixed-radix numeral 1$_∞$7$_{20}$6$_{12}$.
United States customary units are generally mixed radix systems, with multipliers varying from one size unit to the next in the same manner that units of time do.
Mixed-radix representation is also relevant to mixed-radix versions of the Cooley–Tukey FFT algorithm, in which the indices of the input values are expanded in a mixed-radix representation, the indices of the output values are expanded in a corresponding mixed-radix representation with the order of the bases and digits reversed, and each subtransform can be regarded as a Fourier transform in one digit for all values of the remaining digits.

## Manipulation

Mixed-radix numbers of the same base can be manipulated using a generalization of manual arithmetic algorithms. Conversion of values from one mixed base to another is easily accomplished by first converting the place values of the one system into the other, and then applying the digits from the one system against these.
APL and J include operators to convert to and from mixed-radix systems.

## Factorial number system

Another proposal is the so-called factorial number system:
| Radix | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 |
| Place value | 7! | 6! | 5! | 4! | 3! | 2! | 1! | 0! |
| Place value in decimal | 5040 | 720 | 120 | 24 | 6 | 2 | 1 | 1 |
| Highest digit allowed | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
For example, the biggest number that could be represented with six digits would be 543210 which equals 719 in decimal: 5×5! + 4×4! + 3×3! + 2×2! + 1×1! It might not be clear at first sight but the factorial based numbering system is unambiguous and complete. Every number can be represented in one and only one way because the sum of respective factorials multiplied by the index is always the next factorial minus one:
    $\sum _{i=0}^{n}(([i+1]+1)-1)\cdot ([i]+1)!=([n+1]+1)!-1$
There is a natural mapping between the integers 0, ..., n! − 1 and permutations of n elements in lexicographic order, which uses the factorial representation of the integer, followed by an interpretation as a Lehmer code.
The above equation is a particular case of the following general rule for any radix (either standard or mixed) base representation which expresses the fact that any radix (either standard or mixed) base representation is unambiguous and complete. Every number can be represented in one and only one way because the sum of respective weights multiplied by the index is always the next weight minus one:
    $\sum _{i=0}^{n}(m_{i+1}-1)\cdot M_{i}=M_{n+1}-1$, where $M_{i}=\prod _{j=1}^{i}m_{j},m_{j}>1,M_{0}=1$,
which can be easily proved with mathematical induction.

## Primorial number system

Another proposal is the number system with successive prime numbers as radix, whose place values are primorial numbers, considered by S. S. Pillai, Richard K. Guy (sequence A049345 in the OEIS), and other authors:
| Radix | 19 | 17 | 13 | 11 | 7 | 5 | 3 | 2 |
| Place value | (p$_7$=17)# | (p$_6$=13)# | (p$_5$=11)# | (p$_4$=7)# | (p$_3$=5)# | (p$_2$=3)# | (p$_1$=2)# | (p$_0$=1)# |
| Place value in decimal | 510510 | 30030 | 2310 | 210 | 30 | 6 | 2 | 1 |
| Highest digit allowed | 18 | 16 | 12 | 10 | 6 | 4 | 2 | 1 |
    $\sum _{i=0}^{n}(p_{i+1}-1)\cdot p_{i}\#=p_{n+1}\#-1$ where $p_{i}\#=\prod _{j=1}^{i}p_{j}$, and p$_j$ = jth prime, p$_0$# = p$_0$ = 1.