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.

A278313 Number of letters "I" in Roman numeral representation of n.

This page as a plain text file.
%I A278313 #66 Feb 16 2025 08:33:37
%S A278313 1,2,3,1,0,1,2,3,1,0,1,2,3,1,0,1,2,3,1,0,1,2,3,1,0,1,2,3,1,0,1,2,3,1,
%T A278313 0,1,2,3,1,0,1,2,3,1,0,1,2,3,1,0,1,2,3,1,0,1,2,3,1,0,1,2,3,1,0,1,2,3,
%U A278313 1,0,1,2,3,1,0,1,2,3,1,0,1,2,3,1,0,1,2,3,1,0,1,2,3,1,0,1,2,3,1,0
%N A278313 Number of letters "I" in Roman numeral representation of n.
%C A278313 Period 5: repeat [1, 2, 3, 1, 0]. - _Omar E. Pol_, Nov 19 2016
%C A278313 For large numbers we have the examples: 8000 -> VMMM (underline the V); 80000 -> LXXX (underline the LXXX); 800000 -> DCCC (underline the DCCC); ... see The Rules of Roman Numerals under Links. - _José de Jesús Camacho Medina_, Nov 21 2016
%H A278313 K6Math.com, <a href="http://www.printable-math-worksheets.com/support-files/chart-rules-roman-numerals.pdf">The Rules of Roman Numerals</a>
%H A278313 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/RomanNumerals.html">Roman numerals </a>
%H A278313 Wikipedia, <a href="http://en.wikipedia.org/wiki/Roman_numerals">Roman numerals</a>
%H A278313 <a href="/index/Rec#order_05">Index entries for linear recurrences with constant coefficients</a>, signature (0,0,0,0,1).
%F A278313 a(n) = (n mod 5) - ((3n + 2n^2 + 3n^3 + 2n^4) mod 5).
%F A278313 G.f.: x*(1 + 2*x + 3*x^2 + x^3)/((1 - x)*(1 + x + x^2 + x^3 + x^4)). - _Ilya Gutkovskiy_, Nov 20 2016
%F A278313 From _Wesley Ivan Hurt_, Dec 26 2016: (Start)
%F A278313 a(n) = a(n-5) for n > 5.
%F A278313 a(n) = (7 + (n mod 5) + 2*((n+1) mod 5) - ((n+2) mod 5) - ((n+3) mod 5) - ((n+4) mod 5))/5. (End)
%F A278313 a(n) = 1 + (2/5)*(1 + 2*cos(2*(n-3)*Pi/5) + 2*cos(4*(n-3)*Pi/5) + cos(2*(n-2)*Pi/5) + cos(4*(n-2)*Pi/5) - cos(2*n*Pi/5) - cos(4*n*Pi/5)). - _Wesley Ivan Hurt_, Oct 04 2018
%e A278313 a(1) = 1 because 1 in Roman numerals is I, which contains only one I.
%e A278313 a(2) = 2 because 2 in Roman numerals is II, which contains two I's.
%e A278313 a(3) = 3 because 3 in Roman numerals is III, which contains three I's.
%e A278313 a(4) = 1 because 4 in Roman numerals is IV, which contains only one I.
%e A278313 a(5) = 0 because 5 in Roman numerals is V, which does not contain I's.
%e A278313 a(6) = 1 because 6 in Roman numerals is VI, which contains only one I.
%e A278313 a(7) = 2 because 7 in Roman numerals is VII, which contains two I's.
%e A278313 a(8) = 3 because 8 in Roman numerals is VIII, which contains three I's.
%e A278313 a(9) = 1 because 9 in Roman numerals is IX, which contains only one I.
%e A278313 a(10) = 0 because 10 in Roman numerals is X, which does not contain I's.
%e A278313 a(50) = 0 because 50 in Roman numerals is L, which does not contain I's.
%e A278313 a(100) = 0 because 100 in Roman numerals is C, which does not contain I's.
%e A278313 a(500) = 0 because 500 in Roman numerals is D, which does not contain I's.
%e A278313 a(551) = 1 because 551 in Roman numerals is DLI, which contains only one I.
%e A278313 a(1000) = 0 because 1000 in Roman numerals is M, which does not contain I's.
%e A278313 a(1001) = 1 because 1001 in Roman numerals is MI, which contains only one I.
%p A278313 A278313:= n -> [1, 2, 3, 1, 0][(n mod 5)+1]: seq(A278313(n), n=0..100); # _Wesley Ivan Hurt_, Dec 26 2016
%t A278313 Table[Mod[n, 5] - Mod[3n + 2n^2 + 3n^3 + 2n^4, 5], {n, 100}]
%t A278313 Table[StringCount[RomanNumeral@ n, "I"], {n, 105}] (* _Michael De Vlieger_, Nov 24 2016, Version 10.2 *)
%o A278313 (Magma) &cat [[1, 2, 3, 1, 0]^^30]; // _Wesley Ivan Hurt_, Dec 26 2016
%o A278313 (PARI) Vec(x*(1 + 2*x + 3*x^2 + x^3)/((1 - x)*(1 + x + x^2 + x^3 + x^4)) + O(x^50)) \\ _G. C. Greubel_, Dec 26 2016
%Y A278313 Cf. A006968.
%K A278313 nonn,base
%O A278313 1,2
%A A278313 _José de Jesús Camacho Medina_, Nov 17 2016