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.

Showing 1-8 of 8 results.

A061493 Roman numerals written using 1 for I, 2 for V, 3 for X, 4 for L, 5 for C, 6 for D, 7 for M.

Original entry on oeis.org

1, 11, 111, 12, 2, 21, 211, 2111, 13, 3, 31, 311, 3111, 312, 32, 321, 3211, 32111, 313, 33, 331, 3311, 33111, 3312, 332, 3321, 33211, 332111, 3313, 333, 3331, 33311, 333111, 33312, 3332, 33321, 333211, 3332111, 33313, 34, 341, 3411, 34111, 3412
Offset: 1

Views

Author

Frank Ellermann, Jun 12 2001

Keywords

Comments

From Daniel Forgues, Jan 16 2015: (Start)
The Romans in the era of the Roman Empire did not have 0 as a number.
The initial "N" (nulla, meaning "none", or nihil, meaning "nothing") was used as a zero symbol in a table of Roman numerals by Bede or his colleague around 725, but even in the Middle Ages it never became a standard. (End) [Corrected by M. F. Hasler and Peter Luschny, Aug 16 2025]
3999 (MMMCMXCIX) is the largest decimal number that has a well-defined Roman numeral representation. Therefore the sequence deliberately stops there to avoid the ambiguous representations of larger numbers. - Jamie Robert Creasey, May 01 2021
The use of 'N' to indicate 0 or "none" long survived in the historic apothecaries' system of measurement, well into the 20th century, to designate quantities in pharmaceutical prescriptions. - M. F. Hasler, Aug 16 2025

Examples

			a(14) = 312 because 14 = XIV in Roman, and I,V,X are coded as 1,2,3 respectively.
a(66) = 4321, LXVI is 50+10+5+1 = 66, a(44) = 3412, XLIV is -10+50-1+5 = 44
		

Crossrefs

Programs

  • Haskell
    a061493 n = read $ r 1 [] n :: Integer where
      r _ roms 0 = roms
      r p roms z = case p of
        1 -> r 2 (d '1' '2' '3' m) z'
        2 -> r 3 (d '3' '4' '5' m ++ roms) z'
        3 -> r 4 (d '5' '6' '7' m ++ roms) z'
        4 -> replicate z '7' ++ roms
        where (z',m) = divMod z 10
      d i j k c =
        [[],[i],[i,i],[i,i,i],[i,j],[j],[j,i],[j,i,i],[j,i,i,i],[i,k]] !! c
    -- Reinhard Zumkeller, Apr 14 2013
    
  • Mathematica
    Array[FromDigits[Characters@ RomanNumeral[#] /. {"I" -> 1, "V" -> 2, "X" -> 3, "L" -> 4, "C" -> 5, "D" -> 6, "M" -> 7}] &, 44] (* Michael De Vlieger, May 01 2021 *)
  • PARI
    {A061493(n,s="",c=[1000,7,900,57,500,6,400,56,100,5,90,35,50,4,40,34,10,3,9,13,5,2,4,12,1,1])= forstep(i=1,#c,2,while(n>=c[i],n-=c[i];s=Str(s,c[i+1])));eval(s)} \\ M. F. Hasler, Jan 11 2015
    
  • Python
    def f(s, k):
        return s[:2] if k==4 else (s[1]*(k>=5)+s[0]*(k%5) if k<9 else s[0]+s[2])
    def a(n):
        m, c, x, i = n//1000, (n%1000)//100, (n%100)//10, n%10
        return int("7"*m + f("567", c) + f("345", x) + f("123", i))
    print([a(n) for n in range(1, 45)]) # Michael S. Branicky, Aug 24 2022
    
  • Python
    import roman
    def A061493(n, d={ord(c):str(i) for i,c in enumerate("NIVXLCDM")}):
        return int(roman.toRoman(n).translate(d)) # M. F. Hasler, Aug 16 2025

Formula

a(n)=i <=> A003587(i)=n, for i in {1,...,7}, i.e., A061493 is a left inverse of A003587 on {1,...,7}. - M. F. Hasler, Jan 12 2015

Extensions

0 removed again by Georg Fischer, Jan 20 2019

A036746 Numbers with "long" representations in Roman notation: given by last n letters from ...MMMDCCCLXXXVIII.

Original entry on oeis.org

1, 2, 3, 8, 18, 28, 38, 88, 188, 288, 388, 888, 1888, 2888, 3888
Offset: 1

Views

Author

Keywords

Comments

Also: Least number using n symbols when written as Roman numeral, cf. A006968 and A061493. One could prefix a conventional a(0)=0. - M. F. Hasler, Jan 12 2015

Crossrefs

Programs

  • Haskell
    import Data.List (inits, elemIndex)
    import Data.Maybe (mapMaybe)
    a036746 n = a036746_list !! (n-1)
    a036746_list = map (+ 1) $ mapMaybe (`elemIndex` a061493_list)
       (map (read . reverse) $ tail $ inits $ reverse $ show $ a061493 3888)
    -- Reinhard Zumkeller, Apr 14 2013
    
  • Mathematica
    (* assign the 3999 Roman numerals to the variable 'lst' so that lst = {I, II, III, ... MMMCMXCVII, MMMCMXCVIII, MMMCMXCIX}, e.g. using the link to Schildberger's file, then *) f[1] = 1; f[n_] := Block[{k = 2}, While[ StringLength@ SymbolName@ lst[[k]] != n, k++ ]; k]; Array[f, 15] (* Checked by Robert G. Wilson v, Aug 13 2008; edited by M. F. Hasler, Jan 12 2015 *)
  • PARI
    A036746(n)=(n%4+8/9)\.1^(n\4) \\ M. F. Hasler, Jan 12 2015

Formula

a(n) = min{ k>0 | A006968(k)=n }. - M. F. Hasler, Jan 12 2015

Extensions

Checked by Robert G. Wilson v, Aug 13 2008
Edited by M. F. Hasler, Jan 12 2015

A199921 Number of Roman numerals < 4000 with n letters.

Original entry on oeis.org

7, 31, 93, 215, 389, 573, 691, 691, 573, 389, 215, 93, 31, 7, 1
Offset: 1

Views

Author

Martin Renner, Nov 12 2011

Keywords

Comments

Note that the sequence is completely symmetrical with the addition of the single (notional) Roman string of length zero. - Ian Duff, Jun 27 2017

Examples

			a(1) = 7, since there are the seven one-letter roman numerals I, V, X, L, C, D, M.
a(15) = 1, since there is one fifteen-letter roman numeral MMMDCCCLXXXVIII.
		

Crossrefs

Programs

  • Haskell
    import Data.List (group, sort)
    a199921 n = a199921_list !! (n-1)
    a199921_list = map length $ group $ sort $ map (a055642 . a061493) [1..3999]
    -- Reinhard Zumkeller, Apr 14 2013
  • Maple
    for i from 1 to 15 do L[i]:={}: od: for n from 1 to 3999 do L[length(convert(n,roman))]:={op(L[length(convert(n,roman))]),n}; od:
    seq(nops(L[i]),i=1..15); # Martin Renner, Nov 13 2011
  • Mathematica
    romanLetterCount = Table[0, {15}]; j = 1; While[j < 4000, romanLetterCount[[StringLength[IntegerString[j, "Roman"]]]]++; j++]; romanLetterCount (* Alonso del Arte, Nov 12 2011 *)
    Rest[BinCounts[StringLength[RomanNumeral[Range[3999]]]]] (* Paolo Xausa, Mar 19 2024 *)

A003588 Roman numerals with 1 letter, in alphabetical order; then those with 2 letters, etc.

Original entry on oeis.org

100, 500, 1, 50, 1000, 5, 10, 200, 400, 101, 150, 900, 105, 110, 600, 501, 550, 505, 510, 2, 4, 9, 51, 55, 60, 1100, 1500, 1001, 1050, 2000, 1005, 1010, 6, 90, 11, 40, 15, 20, 300, 201, 250, 205, 210, 401, 450, 405, 410, 102, 104, 109, 151, 155, 160, 901, 950, 905, 910, 106
Offset: 1

Views

Author

N. J. A. Sloane, J. H. Conway and John Jackson (ab158(AT)freenet.uchsc.edu)

Keywords

Comments

In this sequence Roman numerals are limited to k <= 3999. - Sean A. Irvine, Dec 04 2022

Crossrefs

Programs

  • Mathematica
    A003588full = FromRomanNumeral[SortBy[RomanNumeral[Range[3999]], StringLength]];
    A003588full[[;;100]] (* Paolo Xausa, Mar 19 2024 *)
  • PARI
    (Roman(n,s=Vecsmall("IVXLCDM"))=Strchr(apply(c->s[c-48], Vec(Vecsmall(Str(A061493(n))))))); vecsort(vector(4000,n,[#t=Roman(n),t]),,1)[1..100] \\ M. F. Hasler, Jan 12 2015

Extensions

Corrected, edited and extended by M. F. Hasler, Jan 12 2015

A093788 The Roman numerals, with "i" replaced by "1", "v" replaced by "5", "x" replaced by 10, etc.

Original entry on oeis.org

1, 11, 111, 15, 5, 51, 511, 5111, 110, 10, 101, 1011, 10111, 1015, 105, 1051, 10511, 105111, 10110, 1010, 10101, 101011, 1010111, 101015, 10105, 101051, 1010511, 10105111, 1010110, 101010, 1010101, 10101011, 101010111, 10101015, 1010105
Offset: 1

Views

Author

William J. Rapaport (rapaport(AT)buffalo.edu), May 17 2004

Keywords

Comments

A more compact and easier to parse version is A061493, where I, V, X, L, ... are replaced by 1, 2, 3, 4, ... The terms of this sequence can be converted to those of A061493 by changing digits '5' to '2' and deleting each digit '0' upon increasing by 2 the nonzero digit to its left. - M. F. Hasler, Jul 25 2016

Crossrefs

Programs

  • PARI
    {A093788(n)=A061493(n,,[1000, 1000, 900, 1001000, 500, 500, 400, 100500, 100, 100, 90, 10100, 50, 50, 40, 1050, 10, 10, 9, 110, 5, 5, 4, 15, 1, 1])} \\ M. F. Hasler, Jul 25 2016

Extensions

Cross-references added and data double-checked by M. F. Hasler, Jul 25 2016

A195526 Numbers written with two Roman numerals.

Original entry on oeis.org

2, 4, 6, 9, 11, 15, 20, 40, 51, 55, 60, 90, 101, 105, 110, 150, 200, 400, 501, 505, 510, 550, 600, 900, 1001, 1005, 1010, 1050, 1100, 1500, 2000
Offset: 1

Views

Author

Kausthub Gudipati, Sep 20 2011

Keywords

Comments

The second group of numbers in A003587.

Examples

			2=II. 4=IV. 6=VI. 9=IX. 11=XI. 15=XV.
		

A118639 Smallest number expressible using the next Roman-numeral symbol under the vinculum system.

Original entry on oeis.org

1, 4, 9, 40, 90, 400, 900, 4000, 9000, 40000, 90000, 400000, 900000
Offset: 1

Views

Author

Greg Huber, May 09 2006

Keywords

Examples

			a(1) = I  (first usage of I);
a(2) = IV (first usage of V);
a(3) = IX (first usage of X);
a(4) = XL (first usage of L);
a(5) = XC (first usage of C);
a(6) = CD (first usage of D);
a(7) = CM (first usage of M).
		

Crossrefs

A195602 Primes written with prime number of Roman numerals.

Original entry on oeis.org

2, 3, 7, 11, 19, 23, 41, 43, 47, 59, 61, 67, 79, 83, 97, 101, 109, 113, 131, 137, 149, 151, 157, 173, 199, 223, 227, 239, 241, 263, 281, 293, 311, 313, 317, 331, 349, 353, 401, 419, 421, 439, 443, 461, 463, 467, 479, 491, 509, 557, 569, 571, 577, 599, 601, 607, 619, 641, 643, 647
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Sep 21 2011

Keywords

Crossrefs

Programs

  • Mathematica
    Select[Prime[Range[200]],PrimeQ[Length[Characters[IntegerString[#, "Roman"]]]]&] (* Harvey P. Dale, Mar 19 2013 *)
  • PARI
    Roman(n)=my(s);while(n,s+=[0,1,2,3,2,1,2,3,4,2][n%10+1];n\=10);s
    forprime(p=2,3999,if(isprime(Roman(p)),print1(p", "))) \\ Charles R Greathouse IV, Oct 06 2011
Showing 1-8 of 8 results.