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-3 of 3 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

A094153 a(n) is least prime p such that 7 is the n-th term in the Euclid-Mullin sequence starting at p, or 0 if no such prime p exists.

Original entry on oeis.org

7, 0, 2, 43, 11, 13, 31, 149, 347, 23, 439, 223, 461, 173, 5, 71, 197, 1153, 191, 307, 1657, 971, 9473, 19, 2399, 1607, 6781, 89, 9187, 281, 23623, 15077, 25579, 17203
Offset: 1

Views

Author

Labos Elemer, May 05 2004

Keywords

Comments

The sequence is not monotonic. Compare to A093882.
Next term exceeds 50000. - Sean A. Irvine, Jan 12 2012

Examples

			a(5)=11 because p=7 first arises in EM at position 5, which is initiated with 11: {11,2,23,3,7,10627,433}; see A051309.
		

Crossrefs

Extensions

Definition clarified, terms corrected and extended by Sean A. Irvine, Apr 15 2011
More terms from Sean A. Irvine, May 22 2011
25579 and 17203 from Sean A. Irvine, Jan 11 2012

A105247 Product of digits of Roman Numerals.

Original entry on oeis.org

1, 1, 1, 5, 5, 5, 5, 5, 10, 10, 10, 10, 10, 50, 50, 50, 50, 50, 100, 100, 100, 100, 100, 500, 500, 500, 500, 500, 1000, 1000, 1000, 1000, 1000, 5000, 5000, 5000, 5000, 5000, 10000, 500, 500, 500, 500, 2500, 2500, 2500, 2500, 2500, 5000, 50, 50, 50, 50, 250
Offset: 1

Views

Author

Jonathan Vos Post, Apr 14 2005

Keywords

Comments

New Roman Numerals A006968 (i.e., 4 = IV, not IIII). Related to sum of digits of n in Roman numeral representation A093783.

Examples

			a(3) = 1 because 3 = "III" and I*I*I = I = 1.
a(4) = 5 because 4 = "IV" and I*V = V = 5.
a(9) = 10 because 9 = "IX" and I*X = X = 10.
a(14) = 50 because 14 = "XIV" and X*I*V = L = 50.
a(19) = 100 because 19 = "XIX" and X*I*X = C = 100.
a(24) = 500 because 24 = "XXIV" and X*X*I*V = D = 500.
a(29) = 1000 because 29 = "XXIX" and X*X*I*X = M = 1000.
a(34) = 5000 because 34 = "XXXIV" and X*X*X*I*V = 5000.
a(39) = 10000 because 39 = "XXXIX" and X*X*X*I*X = myriad = 10000.
a(40) = 500 because 40 = "XL" and X*L = D = 500.
a(44) = 2500 because 44 = "XLIV" and X*L*I*V = MMD = 2500.
a(49) = 5000 because 49 = "XLIX" and X*L*I*X = 5000.
a(50) = 50 because 50 = L.
		

Crossrefs

Programs

  • Maple
    with(StringTools): A105247 := proc(n) local r: r:=convert(n, roman): return mul(parse(SubstituteAll( SubstituteAll( SubstituteAll( SubstituteAll( SubstituteAll( SubstituteAll( SubstituteAll(r[j], "I", "1"), "V", "5"), "X", "10"), "L", "50"), "C", "100"), "D", "500"), "M", "1000")),j=1..length(r)): end: seq(A105247(n),n=1..54); # Nathaniel Johnston, May 18 2011
Showing 1-3 of 3 results.