Maximum Roman Numeral Length
Maximum Roman Numeral Length
Write a function that finds the maximum length of any Roman numeral up to n.
More Details
More Details
The first five Roman numerals are I, II, III, IV, V, and so the maximum length of any Roman numeral up to is 3.
n=5
What Your Function Should Do
What Your Function Should Do
Write a function MaxRomanLength that takes a positive integer n as an input and outputs the maximum length of any Roman numeral up to n. Use to generate the numerals.
In[1] :=
Out[1] =
4
In[2] :=
Out[2] =
8
In[3] :=
Out[3] =
12
More Examples
More Examples
In[]:=
MaxRomanLength[n_Integer?Positive]:=Max[StringLength/@RomanNumeral[Range[n]]]
Note: to save your work on |
Challenges and keep track of progress. |