A120433 Numbers whose Roman numeral representation uses the subtractive notation.
4, 9, 14, 19, 24, 29, 34, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 54, 59, 64, 69, 74, 79, 84, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 104, 109, 114, 119, 124, 129, 134, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 154, 159, 164, 169, 174
Offset: 1
Examples
In Roman numerals, 14 is XIV, that is, X + (V - I) = 10 + (5 - 1) = 14, so 14 is in the sequence. In Roman numerals, 15 is XV, meaning X + V = 10 + 5 = 15, which does not use subtractive notation, so 15 is not in the sequence.
Links
- Nathaniel Johnston, Table of n, a(n) for n = 1..1952 (complete up to 3999)
Crossrefs
Programs
-
Maple
with(StringTools): for n from 1 to 300 do r:=convert(n,roman): if(Search("IV",r)>0 or Search("IX",r)>0 or Search("XL",r)>0 or Search("XC",r)>0 or Search("CD",r)>0 or Search("CM",r)>0)then printf("%d, ", n): fi: od: # Nathaniel Johnston, May 18 2011
-
Mathematica
Select[Range[3999], StringContainsQ[RomanNumeral[#], {"IV", "IX", "XL", "XC", "CD", "CM"}] &] (* Michael De Vlieger, Aug 20 2024 *)
-
Python
def ok(n): return {"4", "9"} & set(str(n)) afull = [k for k in range(4000) if ok(k)] # Michael S. Branicky, Aug 20 2024
Comments