A387014 Middle element of the list {1, 2, 3, ..., 2n-1} when elements are sorted lexicographically by their Roman numeral representations.
1, 2, 3, 4, 9, 5, 6, 7, 8, 10, 11, 12, 13, 14, 19, 15, 16, 17, 18, 20, 18, 17, 16, 15, 48, 47, 46, 45, 49, 44, 43, 42, 41, 40, 19, 14, 13, 12, 11, 10, 8, 7, 6, 5, 88, 5, 6, 7, 8, 10, 8, 7, 6, 5, 88, 87, 86, 85, 89, 84, 83, 82, 81, 80, 78, 77, 76, 75, 79, 74, 73, 72, 71, 70
Offset: 1
Examples
For n = 5, the 2n-1 list elements sorted by Roman numerals are I, II, III, IV, IX, V, VI, VII, VIII and the middle element is IX = 9 = a(5).
Links
- José Hernández, Table of n, a(n) for n = 1..2000
Crossrefs
Cf. A036742.
Programs
-
Mathematica
Table[SortBy[Range[2*n-1], RomanNumeral][[n]], {n, 100}] (* Misha Lavrov via SeqFan *)
-
Python
import roman def A387014(n): return roman.fromRoman(sorted(roman.toRoman(k)for k in range(1,2*n))[n-1]) # M. F. Hasler, Aug 18 2025
Comments