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!)
A093783 Sum of digits of n in Roman numeral representation. 4
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 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
LINKS
Eric Weisstein's World of Mathematics, Roman Numerals
Wikipedia, Roman numerals
EXAMPLE
n=42 == XLII: a(42) = 'X' + 'L' + 'I' + 'I' = 10+50+1+1 = 62.
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 *)
PROG
(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
CROSSREFS
Sequence in context: A327669 A253413 A337355 * A096861 A118738 A175067
KEYWORD
nonn,easy,base
AUTHOR
Reinhard Zumkeller, May 17 2004
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 18 04:56 EDT 2024. Contains 371767 sequences. (Running on oeis4.)