Input:
An integer.
Output:
- First convert the integer to it's equivalent Roman Numeral.
- Then convert each capital letter of that Roman Numeral to their ASCII/UNICODE decimal value.
- And output the sum of those.
Example:
1991 -> MCMXCI -> 77+67+77+88+67+73 -> 449 ^ input ^ output Roman Numerals:

Here is a perhaps useful Roman Numeral Converter.
Challenge rules:
- Standard Roman Numeral rules are applied, so no alternative forms like
IIIIorVIIIIinstead ofIVandIX.* - The Macron lines above the Roman Numerals past 1,000 are
¯(UNICODE nr. 175). So one line counts as+175and two as+350. - You are allowed to use any kind of input and output type, as long as it represents the integers.
- The test cases will be in the range of
1 - 2,147,483,647.
* Roman Numeral rules (quote from Wikipedia):
Numbers are formed by combining symbols and adding the values, so
IIis two (two ones) andXIIIis thirteen (a ten and three ones). Because each numeral has a fixed value rather than representing multiples of ten, one hundred and so on, according to position, there is no need for "place keeping" zeros, as in numbers like 207 or 1066; those numbers are written asCCVII(two hundreds, a five and two ones) andMLXVI(a thousand, a fifty, a ten, a five and a one).Symbols are placed from left to right in order of value, starting with the largest. However, in a few specific cases, to avoid four characters being repeated in succession (such as
IIIIorXXXX), subtractive notation is often used as follows:
Iplaced beforeVorXindicates one less, so four isIV(one less than five) and nine isIX(one less than ten)Xplaced beforeLorCindicates ten less, so forty isXL(ten less than fifty) and ninety isXC(ten less than a hundred)Cplaced beforeDorMindicates a hundred less, so four hundred isCD(a hundred less than five hundred) and nine hundred isCM(a hundred less than a thousand)
For example,MCMIVis one thousand nine hundred and four, 1904 (Mis a thousand,CMis nine hundred andIVis four).Some examples of the modern use of Roman numerals include:
1954 asMCMLIV; 1990 asMCMXC; 2014 asMMXIV
SOURCE
General rules:
- This is code-golf, so shortest answer in bytes wins.
Don't let code-golf languages discourage you from posting answers with non-codegolfing languages. Try to come up with an as short as possible answer for 'any' programming language. - Standard rules apply for your answer, so you are allowed to use STDIN/STDOUT, functions/method with the proper parameters, full programs. Your call.
- Default Loopholes are forbidden.
- If possible, please add a link with a test for your code.
- Also, please add an explanation if necessary.
Test cases:
100 -> 67 1 -> 73 4 -> 159 22 -> 322 5000 -> 261 2016 -> 401 1000000000 -> 427 1991 -> 449 9999 -> 800 1111111111 -> 2344 2147483647 -> 5362
9999->M(X)CMXCIX->77+263+67+77+88+67+73+88->800and2147483647->((MMCXLV)MMCDLXXX)MMMDCXLVII->427+427+417+438+426+436 + 252+252+242+243+251+263+263+263 + 77+77+77+68+67+88+76+86+73+73->5362. So I've corrected the second, but the9999was correct. \$\endgroup\$2222222222isn't in the given range. Also I agree with5362. \$\endgroup\$