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.

This page as a plain text file.
%I A057226 #16 Feb 16 2025 08:32:43
%S A057226 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,
%T A057226 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,
%U A057226 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
%N A057226 Number of different symbols needed to express n as a Roman numeral.
%C A057226 Sequence created using classic Roman numerals, i.e., 99 = XCIX, not the questionable IC.
%H A057226 Nathaniel Johnston, <a href="/A057226/b057226.txt">Table of n, a(n) for n = 1..3999</a>
%H A057226 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/RomanNumerals.html">Roman Numerals</a>
%H A057226 Wikipedia, <a href="http://en.wikipedia.org/wiki/Roman_numerals">Roman numerals</a>
%F A057226 a(n) = A043537(A061493(n)). - _Reinhard Zumkeller_, Apr 14 2013
%e A057226 a(97) = 4 as you need I, V, X and C to express XCVII.
%p A057226 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
%t A057226 Table[Length[Union[Characters[IntegerString[n,"Roman"]]]],{n,110}] (* _Harvey P. Dale_, Mar 18 2013 *)
%o A057226 (Haskell)
%o A057226 a057226 = a043537 . a061493  -- _Reinhard Zumkeller_, Apr 14 2013
%Y A057226 Cf. A043537, A061493.
%K A057226 base,easy,nonn
%O A057226 1,4
%A A057226 Helge T. Blohmer (crusher(AT)k-town.de), Sep 19 2000