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

A093783 Sum of digits of n in Roman numeral representation.

Original entry on oeis.org

1, 2, 3, 6, 5, 6, 7, 8, 11, 10, 11, 12, 13, 16, 15, 16, 17, 18, 21, 20, 21, 22, 23, 26, 25, 26, 27, 28, 31, 30, 31, 32, 33, 36, 35, 36, 37, 38, 41, 60, 61, 62, 63, 66, 65, 66, 67, 68, 71, 50, 51, 52, 53, 56, 55, 56, 57, 58, 61, 60, 61, 62, 63, 66, 65, 66, 67, 68
Offset: 1

Views

Author

Reinhard Zumkeller, May 17 2004

Keywords

Examples

			n=42 == XLII: a(42) = 'X' + 'L' + 'I' + 'I' = 10+50+1+1 = 62.
		

Crossrefs

Programs

  • Haskell
    a093783 n = q 0 $ a061493 n where
         q s 0 = s
         q s x = q (s + [0,1,5,10,50,100,500,1000] !! d') x'
                 where  (x',d) = divMod x 10; d' = fromInteger d
    -- Reinhard Zumkeller, Apr 14 2013
    (HP 49G calculator)
    ::
      CK1&Dispatch
      # FF
      ::
        FPTR2 ^DupQIsZero?
        caseSIZEERR
        FPTR2 ^Z>S
        Z0_
        SWAP
        DUPLEN$
        ZERO_DO
        DUP
        ISTOP-INDEX
        SUB$1#
        BINT48
        #-
        BINT4
        OVER#=
        OVER
        BINT9
        #=
        OR
        IT
        #2+
        FPTR2 ^#>Z
        Z10_
        INDEX@
        FPTR2 ^RP#
        FPTR2 ^RMULText
        ROT
        FPTR2 ^RADDext
        SWAPLOOP
        DROP
      ;
    ;
    Gerald Hillier, Sep 08 2015
  • Maple
    A093783 := proc(n) local r: r:=convert(n, roman): return add(convert(r[j], arabic), j=1..length(r)): end: seq(A093783(n), n=1..68); # Nathaniel Johnston, May 18 2011
  • Mathematica
    Total[#2 FromRomanNumeral[#1] & @@@ Tally[Characters@ RomanNumeral@ #]] & /@ Range@ 68 (* Michael De Vlieger, Sep 08 2015, Version 10.2 *)

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

A356726 Integers which have in Roman numerals more distinct symbols than any smaller number.

Original entry on oeis.org

1, 4, 14, 44, 144, 444, 1444
Offset: 1

Views

Author

Alain Cousquer, Aug 24 2022

Keywords

Comments

Indices of record highs in A057226.
Smallest number whose Roman notation has exactly n distinct symbols.
The sequence is finite because 1444 is the smallest number using the symbols I,V,X,L,C,D,M.

Examples

			For n = 3, a(3) = 14 because 14 = XIV which is the smallest number with 3 symbols in Roman notation.
		

Crossrefs

Programs

  • Mathematica
    kmax=1500; a={}; n=1; For[k=1, k<=kmax, k++, If[Length[DeleteDuplicates[Characters[RomanNumeral[k]]]] == n, AppendTo[a, k]; n++; k=1]]; a (* Stefano Spezia, Aug 26 2022 *)
Showing 1-4 of 4 results.