%I #28 Mar 19 2024 21:09:11
%S 7,31,93,215,389,573,691,691,573,389,215,93,31,7,1
%N Number of Roman numerals < 4000 with n letters.
%C Note that the sequence is completely symmetrical with the addition of the single (notional) Roman string of length zero. - _Ian Duff_, Jun 27 2017
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/RomanNumerals.html">Roman Numerals</a>.
%H Wikipedia, <a href="http://en.wikipedia.org/wiki/Roman_numerals">Roman numerals</a>
%e a(1) = 7, since there are the seven one-letter roman numerals I, V, X, L, C, D, M.
%e a(15) = 1, since there is one fifteen-letter roman numeral MMMDCCCLXXXVIII.
%p for i from 1 to 15 do L[i]:={}: od: for n from 1 to 3999 do L[length(convert(n,roman))]:={op(L[length(convert(n,roman))]),n}; od:
%p seq(nops(L[i]),i=1..15); # _Martin Renner_, Nov 13 2011
%t romanLetterCount = Table[0, {15}]; j = 1; While[j < 4000, romanLetterCount[[StringLength[IntegerString[j, "Roman"]]]]++; j++]; romanLetterCount (* _Alonso del Arte_, Nov 12 2011 *)
%t Rest[BinCounts[StringLength[RomanNumeral[Range[3999]]]]] (* _Paolo Xausa_, Mar 19 2024 *)
%o (Haskell)
%o import Data.List (group, sort)
%o a199921 n = a199921_list !! (n-1)
%o a199921_list = map length $ group $ sort $ map (a055642 . a061493) [1..3999]
%o -- _Reinhard Zumkeller_, Apr 14 2013
%Y Cf. A003587, A006968.
%Y Cf. A055642, A061493.
%K nonn,fini,full
%O 1,1
%A _Martin Renner_, Nov 12 2011