cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A387014 Middle element of the list {1, 2, 3, ..., 2n-1} when elements are sorted lexicographically by their Roman numeral representations.

Original entry on oeis.org

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

Views

Author

José Hernández, Aug 13 2025

Keywords

Comments

Usual Roman numeral representations are taken as ending at 3999 so that here n <= 2000.
a(21) = 18 is the first repeated element, and 21 is also the least positive integer not in this sequence, which has 1690 distinct terms. More exhaustively, the positive integers not in this sequence are 21 .. 39, 90 .. 100, 200 .. 236, 239 .. 399, 450 .. 484, 489, 900 .. 999, 1005 .. 1008, 1010 .. 1049, 1090 .. 1099, 2001 .. 2099, 2101 .. 2199, 2205 .. 2208, 2210 .. 2249, 2251 .. 2299 and 2400 .. oo (where a .. b means all integers from a to b). - M. F. Hasler, Aug 18 2025

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).
		

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