A356721 Numbers written using exactly two distinct Roman numerals.
4, 6, 7, 8, 9, 11, 12, 13, 15, 19, 21, 22, 23, 25, 29, 31, 32, 33, 35, 39, 40, 51, 52, 53, 55, 60, 70, 80, 90, 101, 102, 103, 105, 110, 120, 130, 150, 190, 201, 202, 203, 205, 210, 220, 230, 250, 290, 301, 302, 303, 305, 310, 320, 330, 350, 390, 400, 501, 502
Offset: 1
Examples
4, written IV, and 8, written VIII, are terms. 14, written XIV, is not a term.
Links
- Wikipedia, Roman numerals
Programs
-
Mathematica
kmax=502; a={}; For[k=1, k<=kmax, k++, If[Length[DeleteDuplicates[Characters[RomanNumeral[k]]]] == 2, AppendTo[a,k]]]; a (* Stefano Spezia, Aug 26 2022 *)
-
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 roman(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 ok(n): return len(set(roman(n))) == 2 print([k for k in range(503) if ok(k)]) # Michael S. Branicky, Aug 24 2022
Comments