Eric Weisstein's World of Mathematics, <a href="httphttps://mathworld.wolfram.com/RomanNumerals.html">Roman Numerals</a>
Eric Weisstein's World of Mathematics, <a href="httphttps://mathworld.wolfram.com/RomanNumerals.html">Roman Numerals</a>
reviewed
approved
proposed
reviewed
editing
proposed
(Python)
def f(s, k):
return s[:2] if k==4 else (s[1]*(k>=5)+s[0]*(k%5) if k<9 else s[0]+s[2])
def r(n):
m, c, x, i = n//1000, (n%1000)//100, (n%100)//10, n%10
return "M"*m + f("CDM", c) + f("XLC", x) + f("IVX", i)
def afull():
v = {"I":1, "V":5, "X":10, "L":50, "C":100, "D":500, "M":1000}
ans = []
for i in range(1, 4000): ans.extend([v[d] for d in r(i)])
return ans
print(afull()[:80]) # Michael S. Branicky, Mar 04 2024
proposed
editing
editing
proposed
A093796full = Flatten[FromRomanNumeral[Characters[RomanNumeral[ Range[3999]]]]]; A093796full[[; ; 100]] (* _Paolo Xausa_, Mar 03 2024 *)
A093796full[[;; 100]] (* Paolo Xausa, Mar 03 2024 *)
A093796full = Flatten[FromRomanNumeral[Characters[RomanNumeral[ Range[3999]]]]]; A093796full[[;; 100]] (* Paolo Xausa, Mar 03 2024 *)
Sequence of digit-values after concatenating the natural numbers < 4000 in Roman numeral representation.
A093796full = Flatten[FromRomanNumeral[Characters[RomanNumeral[Range[3999]]]]]; A093796full[[;; 100]] (* Paolo Xausa, Mar 03 2024 *)
nonn,base,easy,fini,full,changed