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.

A003587 Roman numerals with 1 letter, in numerical order; then those with 2 letters, etc.

This page as a plain text file.
%I A003587 #37 Mar 19 2024 11:47:49
%S A003587 1,5,10,50,100,500,1000,2,4,6,9,11,15,20,40,51,55,60,90,101,105,110,
%T A003587 150,200,400,501,505,510,550,600,900,1001,1005,1010,1050,1100,1500,
%U A003587 2000,3,7,12,14,16,19,21,25,30,41,45,52,54,56,59,61,65,70,91,95,102,104,106,109,111,115,120,140,151
%N A003587 Roman numerals with 1 letter, in numerical order; then those with 2 letters, etc.
%C A003587 The sequence is finite because 3999 is the largest number that can be written using the symbols I,V,X,L,C,D,M. -  _J. Lowell_, Nov 17 2020
%C A003587 The Romans had symbols for 5000, 10000, 50000, and 100000, but they have no simple equivalents in our current alphabet. See The Book of Numbers, p. 19. The symbol for 100000 is sometimes represented by (((|))). - _N. J. A. Sloane_, Nov 28 2020
%D A003587 J. H. Conway and R. K. Guy, The Book of Numbers, Copernicus Press, NY, 1996, p. 19.
%H A003587 Maxim Skorohodov, <a href="/A003587/b003587.txt">Table of n, a(n) for n = 1..3999</a>
%e A003587 Written in Roman numerals, the sequence reads: I, V, X, L, C, D, M, II, IV, VI, IX, XI, XV, XX, XL, LI, LV, LX, XC, CI, CV, CX, CL, CC, CD, DI, DV, DX, DL, DC, CM, MI, MV, MX, MV, MC, MD, MM, III, VII, XII, ... - _M. F. Hasler_, Jan 12 2015
%t A003587 A003587full = SortBy[Range[3999], StringLength[RomanNumeral[#]] &];
%t A003587 A003587full[[;;100]] (* _Paolo Xausa_, Mar 19 2024 *)
%o A003587 (PARI) for(d=1,4,for(n=d,d*1000,A006968(n)==d && print1(n","))) \\ _M. F. Hasler_, Jan 12 2015
%o A003587 (Python)
%o A003587 def f(s, k):
%o A003587     return s[:2] if k==4 else (s[1]*(k>=5)+s[0]*(k%5) if k<9 else s[0]+s[2])
%o A003587 def roman(n):
%o A003587     m, c, x, i = n//1000, (n%1000)//100, (n%100)//10, n%10
%o A003587     return "M"*m + f("CDM", c) + f("XLC", x) + f("IVX", i)
%o A003587 def afull():
%o A003587     return sorted(list(range(1, 4000)), key=lambda x: (len(roman(x)), x))
%o A003587 print(afull()) # _Michael S. Branicky_, Dec 04 2022
%Y A003587 Cf. A003588, A036746, A061493, A006968.
%K A003587 nonn,base,fini,full,look
%O A003587 1,2
%A A003587 _N. J. A. Sloane_, _J. H. Conway_ and John Jackson (ab158(AT)freenet.uchsc.edu)
%E A003587 More terms from _M. F. Hasler_, Jan 12 2015