login
A120433
Numbers n with property that the Roman numeral for n uses the subtractive notation.
1
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,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
Sequence in context: A190086 A313114 A313115 * A277601 A172324 A313116
KEYWORD
base,easy,nonn
AUTHOR
Christian Amet, Jul 13 2006
STATUS
approved