Problem #PRU-5163

Problems Number theory Numeral systems

Problem

Roman numerals are a numeral system that originated in ancient Rome and remained the usual way of writing numbers throughout Europe well into the Late Middle Ages. Numbers are written as combinations of letters from the Latin alphabet, each letter with a fixed integer value:

I&V&X&L&C&D&M
1&5&10&50&100&500&1000

For example the first \(12\) numbers in Roman Numerals are written as: \(I,\,II,\, III,\, IV,\, V,\, VI,\, VII,\, VIII,\, IX,\, X,\, XI,\, XII\), where the notations \(IV\) and \(IX\) can be read as "one less than five" and "one less than ten" correspondingly. A number containing two or more decimal digits is built by appending the Roman numeral equivalent for each digit, from highest to lowest, as in the following examples: the current year \(2024\) as \(MMXXIV\), number \(17\) as \(XVII\) and number \(42\) as \(XLII\) or \(XXXXII\). Let’s see how to multiply Roman numerals by multiplying \(17\) and \(42\).