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-10 of 46 results. Next

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

A002963 Number of chisel strokes required for Roman numerals for n.

Original entry on oeis.org

1, 2, 3, 3, 2, 3, 4, 5, 3, 2, 3, 4, 5, 5, 4, 5, 6, 7, 5, 4, 5, 6, 7, 7, 6, 7, 8, 9, 7, 6, 7, 8, 9, 9, 8, 9, 10, 11, 9, 4, 5, 6, 7, 7, 6, 7, 8, 9, 7, 2, 3, 4, 5, 5, 4, 5, 6, 7, 5, 4, 5, 6, 7, 7, 6, 7, 8, 9, 7, 6, 7, 8, 9, 9, 8, 9, 10, 11, 9, 8, 9, 10, 11, 11, 10, 11, 12, 13, 11, 4, 5, 6, 7, 7, 6, 7, 8, 9, 7, 2, 3, 4
Offset: 1

Views

Author

Keywords

Comments

Chisel strokes for numerals: I,1; V,2; X,2; L,2; C ( = < ),2; D,3; M,4.
For more about Roman numerals, see A006968.
a(A002964(n)) = n. - Reinhard Zumkeller, Apr 14 2013

Crossrefs

Programs

  • Haskell
    a002963 = ch 0 . a061493 where
         ch s 0 = s
         ch s x = ch (s + [0,1,2,2,2,2,3,4] !! d') x'
                  where  (x',d) = divMod x 10; d' = fromInteger d
    -- Reinhard Zumkeller, Apr 14 2013
    
  • Maple
    with(StringTools): A002963 := proc(n) local r: r:=convert(n, roman): return add(parse(SubstituteAll( SubstituteAll( SubstituteAll( SubstituteAll( SubstituteAll( SubstituteAll( SubstituteAll(r[j], "I", "1"), "V", "2"), "X", "2"), "L", "2"), "C", "2"), "D", "3"), "M", "4")), j=1..length(r)): end: seq(A002963(n), n=1..102); # Nathaniel Johnston, May 18 2011
  • Mathematica
    a[n_] := Characters[ IntegerString[n, "Roman"]] /. {"I" -> 1, "V" -> 2, "X" -> 2, "L" -> 2, "C" -> 2, "D" -> 3, "M" -> 4} // Total; Table[a[n], {n, 1, 102}] (* Jean-François Alcover, Sep 10 2013 *)
  • PARI
    {A002963(n, c=[1000, 4, 900, 6, 500, 3, 400, 5, 100, 2, 90, 4, 50, 2, 40, 4, 10, 2, 9, 3, 5, 2, 4, 3, 1, 1], s=0)= forstep(i=1, #c, 2, while(n>=c[i], n-=c[i]; s+=c[i+1])); s} \\ M. F. Hasler, Jul 27 2016
    
  • Python
    a002963 = lambda n: sum((d+1-(d==2))*(i%5)+(d+2-(d==1))*(i>4) if (i+1)%5 else 3+d+(d==2)*(i==9) for d,i in enumerate(map(int,str(n)[::-1])))
    # Nicholas Stefan Georgescu, Feb 27 2023

Extensions

More terms from David W. Wilson
Data double-checked by M. F. Hasler, Jul 27 2016

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

Original entry on oeis.org

1, 5, 10, 50, 100, 500, 1000, 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, 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
Offset: 1

Views

Author

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

Keywords

Comments

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

Examples

			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
		

References

  • J. H. Conway and R. K. Guy, The Book of Numbers, Copernicus Press, NY, 1996, p. 19.

Crossrefs

Programs

  • Mathematica
    A003587full = SortBy[Range[3999], StringLength[RomanNumeral[#]] &];
    A003587full[[;;100]] (* Paolo Xausa, Mar 19 2024 *)
  • PARI
    for(d=1,4,for(n=d,d*1000,A006968(n)==d && print1(n","))) \\ M. F. Hasler, Jan 12 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 roman(n):
        m, c, x, i = n//1000, (n%1000)//100, (n%100)//10, n%10
        return "M"*m + f("CDM", c) + f("XLC", x) + f("IVX", i)
    def afull():
        return sorted(list(range(1, 4000)), key=lambda x: (len(roman(x)), x))
    print(afull()) # Michael S. Branicky, Dec 04 2022

Extensions

More terms from M. F. Hasler, Jan 12 2015

A105446 Number of symbols in the Roman Fibonacci number representation of n.

Original entry on oeis.org

1, 1, 1, 2, 1, 2, 2, 1, 2, 2, 2, 2, 1, 2, 2, 2, 3, 2, 2, 2, 1, 2, 2, 2, 3, 2, 3, 3, 2, 3, 2, 2, 2, 1, 2, 2, 2, 3, 2, 3, 3, 2, 3, 3, 3, 3, 2, 3, 3, 2, 3, 2, 2, 2, 1, 2, 2, 2, 3, 2, 3, 3, 2, 3, 3, 3, 3, 2, 3, 3, 3, 4, 3, 3, 3, 2, 3, 3, 3, 4
Offset: 1

Views

Author

Jonathan Vos Post, Apr 09 2005

Keywords

Comments

The Roman Fibonacci numbers are composed from the values of the Fibonacci Numbers (A000045) with the grammar of the Roman Numerals (A006968) and a few rules to disambiguate.
The alphabet: {1, 2, 3, 5, 8, A=13, B=21, C=34, D=55, E=89, F=144, ...}.
Rule one: of the infinite set of representations of integers by this grammar, always restrict to the subset of those with shortest length.
Rule two: if there are two or more in the subset of shortest representations, restrict to the subset with fewest subtractions [A31 preferred to 188, B31 preferred to 1AA, CA preferred to 8D, DB preferred to AE].
Rule three: if there are two or more representations per Rules one and two, restrict to the subset with the most duplications of characters [22 preferred to 31, 33 preferred to 51, 55 preferred to 82, 88 preferred to A3, BBB preferred to D53, CC preferred to BE]. We do not need a Rule four for a while...
Lemma: no Roman Fibonacci number requires three consecutive instances of the same symbol. Proof: 3*F(i) = F(i+2) + F(i-2).
Question: what is the asymptotic length of the Roman Fibonacci numbers?

Examples

			a(1) = 1 because 1 is a Fibonacci number, equal to its own representation as a Roman Fibonacci number.
a(4) = 2 because 4 is not a Fibonacci number, but can be represented as the sum or difference of two Fibonacci numbers, with its Roman Fibonacci number representation being "22" (not "31" per rule three).
a(17) = 3 because the Roman Fibonacci number representation of 17 has three symbols, namely "A22" (not "188" per rule two).
a(80) = 4 because the Roman Fibonacci number representation of 80 has four symbols, namely "DB22".
		

References

  • Cajori, F. A History of Mathematical Notations, 2 vols. Bound as One, Vol. 1: Notations in Elementary Mathematics. New York: Dover, pp. 30-37, 1993.
  • Menninger, K. Number Words and Number Symbols: A Cultural History of Numbers. New York: Dover, pp. 44-45 and 281, 1992.
  • Neugebauer, O. The Exact Sciences in Antiquity, 2nd ed. New York: Dover, pp. 4-5, 1969.

Crossrefs

A105447 = integers with A105446(n) = 2. A105448 = integers with A105446(n) = 3. A105449 = integers with A105446(n) = 4. A105450 = integers with A105446(n) = 5. A023150 = integers with A105446(n) = 6. A105452 = integers with A105446(n) = 7. A105453 = integers with A105446(n) = 8. A105454 = integers with A105446(n) = 9. A105455 = integers with A105446(n) = 10.
Appears to be a duplicate of A058978.

Formula

a(n) = number of symbols in the Roman Fibonacci number representation of n, as defined in "Comments." a(n) = 1 iff n is an element of A000045. a(n) = 2 iff the shortest Roman Fibonacci number representation of n is as the sum or difference of two elements of A000045 and n is not an element of A000045.

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

A036788 Length of Roman notation for n <= length of decimal representation.

Original entry on oeis.org

1, 5, 10, 11, 15, 20, 40, 50, 51, 55, 60, 90, 100, 101, 102, 104, 105, 106, 109, 110, 111, 115, 120, 140, 150, 151, 155, 160, 190, 200, 201, 205, 210, 250, 300, 400, 401, 405, 410, 450, 500, 501, 502, 504, 505, 506, 509, 510, 511, 515, 520, 540, 550, 551, 555
Offset: 1

Views

Author

Keywords

Comments

The Roman numeration system used here is the naive one taught in primary school. This sequence, like many others involving numeration systems, is neither well-defined nor interesting for large values of n. - N. J. A. Sloane, Jul 03 2008

Examples

			15 = XV has length 2 in both notations.
		

Crossrefs

Programs

  • Haskell
    a036788 n = a036788_list !! (n-1)
    a036788_list = [x | x <- [1..], a006968 x <= a055642 x]
    -- Reinhard Zumkeller, Apr 20 2013
  • Maple
    for n from 1 to 3999 do if(length(convert(n, roman)) <= length(n))then printf("%d, ", n): fi: od: # Nathaniel Johnston, May 18 2011
  • Mathematica
    Select[Range[560],StringLength[IntegerString[#,"Roman"]]<= IntegerLength[ #]&] (* Harvey P. Dale, Dec 18 2011 *)

Formula

A006968(a(n)) <= A055642(a(n)). - Reinhard Zumkeller, Apr 20 2013

Extensions

Corrected and extended by Larry Reeves (larryr(AT)acm.org), Sep 25 2000

A078715 Palindromic Roman numerals.

Original entry on oeis.org

1, 2, 3, 5, 10, 19, 20, 30, 50, 100, 190, 200, 300, 500, 1000, 1900, 2000, 3000
Offset: 1

Views

Author

Rick L. Shepherd, Dec 19 2002

Keywords

Comments

This sequence is consistent with the Roman numerals as expressed in the Schildberger link. 4 (usually IV now) could be included in a variant of this sequence as IIII is sometimes used (especially on clock faces). To make this or similar sequences well-defined for numbers larger than 3999, it must be decided whether and how to handle the apostrophus (backward-C), the vinculum (bar), the frame, or even other multiplier notations used at various times in representations of larger Roman numerals. Recalling the "Y2K crisis", will there be a(n even milder) "Y4M crisis"? In particular, is 4000 to be represented as MMMM, (I)(I)(I)(I) (where parentheses are used to represent C and the apostrophus), MV (with vinculum over the V), IV (with vinculum over both I and V) or IIII with vinculum over all four I's? If there is no general agreement, could Roman civilization be at risk (once again)?
Indices of terms in A061493 which are also in A002113. - M. F. Hasler, Jan 12 2015

Examples

			I, II, III, V, X, XIX, XX, XXX, L, C, CXC, CC, CCC, D, M, MCM, MM, MMM
		

References

  • Encyclopaedia Britannica, 1981 ed., Vol. 11, "Mathematics, History of", p. 647.
  • Webster's Third New International Dictionary (Unabridged), 1976 ed., "Cardinal Numbers Table" and footnotes, p. 1549.

Crossrefs

Cf. A061493, A006968 (Roman numerals main entry), A002113 (Palindromic Arabic numerals).
Subsequence of A093703.

Programs

  • Haskell
    a078715 n = a078715_list !! (n-1)
    a078715_list = filter ((== 1) . a136522 . a061493) [1..3999]
    -- Reinhard Zumkeller, Apr 14 2013
    
  • Mathematica
    Select[Range[3000], PalindromeQ[RomanNumeral[#]] &] (* Paolo Xausa, Mar 03 2024 *)
  • PARI
    is_A078715(n)=Vecrev(n=Str(A061493(n)))==Vec(n) \\ M. F. Hasler, Jan 12 2015

Formula

A136522(A061493(a(n))) = 1. - Reinhard Zumkeller, Apr 14 2013

A036786 Length of Roman notation for n < length of decimal representation.

Original entry on oeis.org

10, 50, 100, 101, 105, 110, 150, 200, 400, 500, 501, 505, 510, 550, 600, 900, 1000, 1001, 1002, 1004, 1005, 1006, 1009, 1010, 1011, 1015, 1020, 1040, 1050, 1051, 1055, 1060, 1090, 1100, 1101, 1105, 1110, 1150, 1200, 1400, 1500, 1501, 1505, 1510, 1550
Offset: 1

Views

Author

Keywords

Examples

			1000 = M is shorter in Roman numerals, so 1000 is in this sequence.
		

Crossrefs

Programs

  • Haskell
    a036786 n = a036786_list !! (n-1)
    a036786_list = [x | x <- [1..], a006968 x < a055642 x]
    -- Reinhard Zumkeller, Apr 20 2013
  • Maple
    for n from 1 to 3999 do if(length(convert(n,roman)) < length(n))then printf("%d, ",n): fi: od: # Nathaniel Johnston, May 18 2011
  • Mathematica
    Select[Range[2000],StringLength[IntegerString[#,"Roman"]]Harvey P. Dale, Feb 10 2015 *)

Formula

A006968(a(n)) < A055642(a(n)). - Reinhard Zumkeller, Apr 20 2013

Extensions

Corrected by Larry Reeves (larryr(AT)acm.org), Sep 25 2000

A036787 Length of Roman notation for n = length of decimal representation.

Original entry on oeis.org

1, 5, 11, 15, 20, 40, 51, 55, 60, 90, 102, 104, 106, 109, 111, 115, 120, 140, 151, 155, 160, 190, 201, 205, 210, 250, 300, 401, 405, 410, 450, 502, 504, 506, 509, 511, 515, 520, 540, 551, 555, 560, 590, 601, 605, 610, 650, 700, 901, 905, 910, 950, 1003, 1007
Offset: 1

Views

Author

Keywords

Examples

			15 = XV has length 2 in both notations.
		

Crossrefs

Programs

  • Haskell
    a036787 n = a036787_list !! (n-1)
    a036787_list = [x | x <- [1..], a006968 x == a055642 x]
    -- Reinhard Zumkeller, Apr 20 2013
    
  • Maple
    for n from 1 to 3999 do if(length(convert(n, roman)) = length(n))then printf("%d, ", n): fi: od: # Nathaniel Johnston, May 18 2011
  • Mathematica
    Select[Range[1100],StringLength[IntegerString[#,"Roman"]] == IntegerLength[ #]&] (* Harvey P. Dale, Jul 25 2011 *)
  • PARI
    is_A036787(n)=#Str(n)==#Str(A061493(n)) \\ M. F. Hasler, Jan 12 2015

Formula

A006968(a(n)) = A055642(a(n)). - Reinhard Zumkeller, Apr 20 2013

Extensions

Corrected and extended by Larry Reeves (larryr(AT)acm.org), Sep 25 2000

A092196 Number of letters in "old style" Roman numeral representation of n (e.g., IIII rather than IV).

Original entry on oeis.org

0, 1, 2, 3, 4, 1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 2, 3, 4, 5, 6, 2, 3, 4, 5, 6, 3, 4, 5, 6, 7, 3, 4, 5, 6, 7, 4, 5, 6, 7, 8, 4, 5, 6, 7, 8, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 2, 3, 4, 5, 6, 2, 3, 4, 5, 6, 3, 4, 5, 6, 7, 3, 4, 5, 6, 7, 4, 5, 6, 7, 8, 4, 5, 6, 7, 8, 5, 6, 7, 8, 9, 5, 6, 7, 8, 9, 6, 7, 8, 9, 10, 1, 2, 3, 4, 5, 2
Offset: 0

Views

Author

Marc LeBrun, Feb 24 2004

Keywords

Comments

How is this sequence defined for large values? - Charles R Greathouse IV, Feb 01 2011
Also, number of abacus pieces moved (i.e., differing from their initial positions) for the expression of n on a Chinese abacus. A Chinese abacus is also called "suanpan"(CN), "soroban"(JP). - FUNG Cheok Yin, Aug 08 2017

Examples

			a(99)=10 because 99 is LXXXXVIIII.
		

Crossrefs

Cf. A006968.

Programs

Extensions

a(0)=0 prepended by Andrew Howroyd, Oct 19 2017
Showing 1-10 of 46 results. Next