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.

A057226 Number of different symbols needed to express n as a Roman numeral.

Original entry on oeis.org

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

Views

Author

Helge T. Blohmer (crusher(AT)k-town.de), Sep 19 2000

Keywords

Comments

Sequence created using classic Roman numerals, i.e., 99 = XCIX, not the questionable IC.

Examples

			a(97) = 4 as you need I, V, X and C to express XCVII.
		

Crossrefs

Programs

  • Haskell
    a057226 = a043537 . a061493  -- Reinhard Zumkeller, Apr 14 2013
  • Maple
    with(StringTools): A057226 := proc(n) local r: r:=convert(n, roman): return `if`(Search("I",r)>0,1,0) + `if`(Search("V",r)>0,1,0) + `if`(Search("X",r)>0,1,0) + `if`(Search("L",r)>0,1,0) + `if`(Search("C",r)>0,1,0) + `if`(Search("D",r)>0,1,0) + `if`(Search("M",r)>0,1,0): end: seq(A057226(n), n=1..105); # Nathaniel Johnston, May 18 2011
  • Mathematica
    Table[Length[Union[Characters[IntegerString[n,"Roman"]]]],{n,110}] (* Harvey P. Dale, Mar 18 2013 *)

Formula

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