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-2 of 2 results.

A002963 Number of chisel strokes required for Roman numerals for n.

Original entry on oeis.org

1, 2, 3, 3, 2, 3, 4, 5, 3, 2, 3, 4, 5, 5, 4, 5, 6, 7, 5, 4, 5, 6, 7, 7, 6, 7, 8, 9, 7, 6, 7, 8, 9, 9, 8, 9, 10, 11, 9, 4, 5, 6, 7, 7, 6, 7, 8, 9, 7, 2, 3, 4, 5, 5, 4, 5, 6, 7, 5, 4, 5, 6, 7, 7, 6, 7, 8, 9, 7, 6, 7, 8, 9, 9, 8, 9, 10, 11, 9, 8, 9, 10, 11, 11, 10, 11, 12, 13, 11, 4, 5, 6, 7, 7, 6, 7, 8, 9, 7, 2, 3, 4
Offset: 1

Views

Author

Keywords

Comments

Chisel strokes for numerals: I,1; V,2; X,2; L,2; C ( = < ),2; D,3; M,4.
For more about Roman numerals, see A006968.
a(A002964(n)) = n. - Reinhard Zumkeller, Apr 14 2013

Crossrefs

Programs

  • Haskell
    a002963 = ch 0 . a061493 where
         ch s 0 = s
         ch s x = ch (s + [0,1,2,2,2,2,3,4] !! d') x'
                  where  (x',d) = divMod x 10; d' = fromInteger d
    -- Reinhard Zumkeller, Apr 14 2013
    
  • Maple
    with(StringTools): A002963 := proc(n) local r: r:=convert(n, roman): return add(parse(SubstituteAll( SubstituteAll( SubstituteAll( SubstituteAll( SubstituteAll( SubstituteAll( SubstituteAll(r[j], "I", "1"), "V", "2"), "X", "2"), "L", "2"), "C", "2"), "D", "3"), "M", "4")), j=1..length(r)): end: seq(A002963(n), n=1..102); # Nathaniel Johnston, May 18 2011
  • Mathematica
    a[n_] := Characters[ IntegerString[n, "Roman"]] /. {"I" -> 1, "V" -> 2, "X" -> 2, "L" -> 2, "C" -> 2, "D" -> 3, "M" -> 4} // Total; Table[a[n], {n, 1, 102}] (* Jean-François Alcover, Sep 10 2013 *)
  • PARI
    {A002963(n, c=[1000, 4, 900, 6, 500, 3, 400, 5, 100, 2, 90, 4, 50, 2, 40, 4, 10, 2, 9, 3, 5, 2, 4, 3, 1, 1], s=0)= forstep(i=1, #c, 2, while(n>=c[i], n-=c[i]; s+=c[i+1])); s} \\ M. F. Hasler, Jul 27 2016
    
  • Python
    a002963 = lambda n: sum((d+1-(d==2))*(i%5)+(d+2-(d==1))*(i>4) if (i+1)%5 else 3+d+(d==2)*(i==9) for d,i in enumerate(map(int,str(n)[::-1])))
    # Nicholas Stefan Georgescu, Feb 27 2023

Extensions

More terms from David W. Wilson
Data double-checked by M. F. Hasler, Jul 27 2016

A133192 Numbers that require exactly five chisel strokes when written in Roman numerals.

Original entry on oeis.org

8, 13, 14, 16, 19, 21, 41, 53, 54, 56, 59, 61, 91, 103, 104, 106, 109, 111, 151, 201, 400, 502, 505, 510, 550, 600, 1001, 5002, 5005, 5010, 5050, 5100, 10002, 10005, 10010, 10050, 10100, 50002, 50005, 50010, 50050, 50100, 100002, 100005, 100010, 100050, 100100, 500001, 1000000
Offset: 1

Views

Author

Jonathan Vos Post, Oct 09 2007

Keywords

Examples

			Chisel strokes for numerals: I,1; V,2; X,2; L,2; C ( = < ),2; D,3; M,4; 5000 is V with a line over it, 3; 10000 is X with a line over it, 3; 50000 is L with a line over it, 3; 100000 is L with a line over it, 3; 500000 is D with a line over it, 4; 1000000 is M with a line over it, 5. Numerals with two horizontal strokes over them were not common in historical Rome. A002964 has a different evaluation of the strokes of C, as does A118098.
		

Crossrefs

Formula

Numbers n such that A002963(n) = 5.
Showing 1-2 of 2 results.