login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A006968 Number of letters in Roman numeral representation of n.
(Formerly M0417)
47
1, 2, 3, 2, 1, 2, 3, 4, 2, 1, 2, 3, 4, 3, 2, 3, 4, 5, 3, 2, 3, 4, 5, 4, 3, 4, 5, 6, 4, 3, 4, 5, 6, 5, 4, 5, 6, 7, 5, 2, 3, 4, 5, 4, 3, 4, 5, 6, 4, 1, 2, 3, 4, 3, 2, 3, 4, 5, 3, 2, 3, 4, 5, 4, 3, 4, 5, 6, 4, 3, 4, 5, 6, 5, 4, 5, 6, 7, 5, 4, 5, 6, 7, 6, 5, 6, 7, 8, 6, 2, 3, 4, 5, 4, 3, 4, 5, 6, 4, 1, 2, 3, 4, 3, 2 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
How is this sequence defined for large values? - Charles R Greathouse IV, Feb 01 2011
See A078715 for a discussion on the Roman 4M-problem. - Reinhard Zumkeller, Apr 14 2013
The sequence can be considered to be defined via the formula (as A055642 o A061493), so the question is to be posed in A061493, not here. - M. F. Hasler, Jan 12 2015
REFERENCES
GCHQ, The GCHQ Puzzle Book, Penguin, 2016. See page 60.
Netnews group rec.puzzles, Frequently Asked Questions (FAQ) file. (Science Section).
N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
LINKS
Rec.puzzles, Archive
Eric Weisstein's World of Mathematics, Roman Numerals
Wikipedia, Roman numerals
FORMULA
A006968 = A055642 o A061493, i.e., a(n) = A055642(A061493(n)). - M. F. Hasler, Jan 11 2015
MAPLE
A006968 := proc(n) return length(convert(n, roman)): end: seq(A006968(n), n=1..105); # Nathaniel Johnston, May 18 2011
MATHEMATICA
a[n_] := StringLength[ IntegerString[ n, "Roman"]]; Table[a[n], {n, 1, 105}] (* Jean-François Alcover, Dec 27 2011 *)
PROG
(R) as.roman(1 :1024) # N. J. A. Sloane, Aug 23 2009
(Haskell)
a006968 = lenRom 3 where
lenRom 0 z = z
lenRom p z = [0, 1, 2, 3, 2, 1, 2, 3, 4, 2] !! m + lenRom (p - 1) z'
where (z', m) = divMod z 10
-- Reinhard Zumkeller, Apr 14 2013
(PARI) A006968(n)=#Str(A061493(n)) \\ 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 len("M"*m + f("CDM", c) + f("XLC", x) + f("IVX", i))
print([a(n) for n in range(1, 101)]) # Michael S. Branicky, Mar 03 2024
CROSSREFS
Sequence in context: A098236 A152978 A118121 * A058207 A105969 A275892
KEYWORD
nonn,base,nice,easy
AUTHOR
EXTENSIONS
More terms from Eric W. Weisstein
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 24 12:53 EDT 2024. Contains 371943 sequences. (Running on oeis4.)