OFFSET
1,1
COMMENTS
Each number in this sequence has a 4 or a 9 in its decimal representation, corresponding to one of IV, IX, XL, XC, CD, CM. - Alonso del Arte, Jan 05 2018
LINKS
Nathaniel Johnston, Table of n, a(n) for n = 1..1952 (complete up to 3999)
EXAMPLE
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.
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 *)
PROG
(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
CROSSREFS
KEYWORD
base,easy,nonn
AUTHOR
Christian Amet, Jul 13 2006
STATUS
approved