A002904 Delete all letters except c, d, i, l, m, v, x from the US English name of n, then read as Roman numeral if possible, otherwise 0.
0, 0, 0, 0, 4, 9, 5, 1, 1, 0, 55, 55, 1, 0, 1, 9, 5, 1, 1, 0, 0, 0, 0, 0, 4, 9, 5, 1, 1, 1, 1, 1, 1, 1, 0, 0, 4, 2, 2, 0, 0, 0, 0, 0, 4, 9, 5, 1, 1, 1, 1, 1, 1, 1, 0, 0, 4, 2, 2, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 5, 5, 5, 5, 5, 0, 0, 0, 6, 6, 1, 1, 1, 1, 1, 0, 0, 4, 2, 2, 1, 1, 1, 1, 1, 0, 0, 4, 2, 2, 0
Offset: 1
Examples
To get a(5), write 5 = "five", delete 'f' & 'e' to get "iv", Roman for 4 = a(5). To get a(35), write 35 = "thirty five", delete all but 'i's and 'v's, to get "iiv", which is not a legal Roman number*, so a(35) = 0 by definition of the sequence. (*It is never allowed to subtract more than one unit 'I' (or 'X' or 'C') from one of the symbols V, L, D representing 5 times a power of 10, as it is never allowed that one of V, L, D is subtracted from one of I, X, C, M.)
Links
- Michael S. Branicky, Table of n, a(n) for all nonzero a(n).
- Brady Haran and N. J. A. Sloane, What Number Comes Next? (2018), Numberphile video.
- Wikipedia, Roman numerals, as of Feb 19 2020.
Formula
From Michael S. Branicky, Jan 09 2023: (Start)
a(100..999) = 0, due to "dd".
a(k*1000) = 500 for k in {1..4, 10, 14, 20..24, 40..44};
a(k*1000+i) = (500 + a(i))*[a(i) != 0] for i in 1..99 for k in {1..4, 10, 14, 20..24, 40..44}; and
a(n) = 0 for all other 1100 <= n <= 999999, due to "id", "vd", "xd" or "dd".
a(n) = 0 for n >= 10^6, due to "ll".
(End)
Extensions
a(35) and beyond from Michael S. Branicky, Jan 09 2023
Comments