`This page converts the representation of a nonnegative integer between uniradic and factoradic form.`

`One uses uniradic form all the time. The most common use is radix 10 (decimal), but radix 16 (hexadecimal) and radix 2 (binary) are used from time to time.`

`The factoradic representation of an integer is different. It uses base 2 for the least significant digit, base 3 for the next digit, base 4 for the next digit, and so on.`

`This form seems to have been introduced by Randall Munroe in this comic strip, which is explained by explainxkcd here. (He claims unregistered trademark for "factoradic".)`

`Randall decrees this in the mouseover text for that script: "So what do we do when we get to base 10? Do we use A, B, C, etc? No: Numbers larger than about 3.6 million are simply illegal."`

`He means base 11, of course. And that restriction is consistent with his whimsical, mischievous approach in this strip. But the page you're reading now does not impose this restriction. It gets around it in two ways.`

`First, it allows bases as large as 64. Here's the list of relevant digit representations:`

`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz,.`

`Second, if a factoradic expression extends to base 65 or above and a digit value greater than 63 is required, then that digit is represented by more than one character. The first character is a left parenthesis. The final character is a right parenthesis. The characters in between are the digit value, shown in decimal.`

`Have fun.`

uniradic base | |

uniradic string | |

factoradic string | |

convert range from uniradic to factoradic: | |

first in range | |

final in range | |

The source is useful because it can run both as a CGI script and standalone on the command line. Just run it without arguments to get instructions. |