in reply to Golf: Magic Formula for Roman Numerals
A useless thought: in FORTH, they'd be using the /mod operator. That's a division operator that returns both the (integer) quotient, and the remainder. Just look at the pattern:
The factor clearly has a repetitive pattern, with a period of 2, the exponent increments once for every period.
Roman | Factor | Exponent |
---|---|---|
I | 1 | 0 |
V | 5 | 0 |
X | 1 | 1 |
L | 5 | 1 |
C | 1 | 2 |
D | 5 | 2 |
M | 1 | 3 |
|
---|
In Section
Meditations