%I #65 Sep 08 2022 08:46:18
%S 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 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 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 Number of letters "I" in Roman numeral representation of n.
%C Period 5: repeat [1, 2, 3, 1, 0]. - _Omar E. Pol_, Nov 19 2016
%C 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 K6Math.com, <a href="http://www.printable-math-worksheets.com/support-files/chart-rules-roman-numerals.pdf">The Rules of Roman Numerals</a>
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/RomanNumerals.html">Roman numerals </a>
%H Wikipedia, <a href="http://en.wikipedia.org/wiki/Roman_numerals">Roman numerals</a>
%H <a href="/index/Rec#order_05">Index entries for linear recurrences with constant coefficients</a>, signature (0,0,0,0,1).
%F a(n) = (n mod 5) - ((3n + 2n^2 + 3n^3 + 2n^4) mod 5).
%F 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 From _Wesley Ivan Hurt_, Dec 26 2016: (Start)
%F a(n) = a(n-5) for n > 5.
%F 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 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 a(1) = 1 because 1 in Roman numerals is I, which contains only one I.
%e a(2) = 2 because 2 in Roman numerals is II, which contains two I's.
%e a(3) = 3 because 3 in Roman numerals is III, which contains three I's.
%e a(4) = 1 because 4 in Roman numerals is IV, which contains only one I.
%e a(5) = 0 because 5 in Roman numerals is V, which does not contain I's.
%e a(6) = 1 because 6 in Roman numerals is VI, which contains only one I.
%e a(7) = 2 because 7 in Roman numerals is VII, which contains two I's.
%e a(8) = 3 because 8 in Roman numerals is VIII, which contains three I's.
%e a(9) = 1 because 9 in Roman numerals is IX, which contains only one I.
%e a(10) = 0 because 10 in Roman numerals is X, which does not contain I's.
%e a(50) = 0 because 50 in Roman numerals is L, which does not contain I's.
%e a(100) = 0 because 100 in Roman numerals is C, which does not contain I's.
%e a(500) = 0 because 500 in Roman numerals is D, which does not contain I's.
%e a(551) = 1 because 551 in Roman numerals is DLI, which contains only one I.
%e a(1000) = 0 because 1000 in Roman numerals is M, which does not contain I's.
%e a(1001) = 1 because 1001 in Roman numerals is MI, which contains only one I.
%p A278313:= n -> [1, 2, 3, 1, 0][(n mod 5)+1]: seq(A278313(n), n=0..100); # _Wesley Ivan Hurt_, Dec 26 2016
%t Table[Mod[n, 5] - Mod[3n + 2n^2 + 3n^3 + 2n^4, 5], {n, 100}]
%t Table[StringCount[RomanNumeral@ n, "I"], {n, 105}] (* _Michael De Vlieger_, Nov 24 2016, Version 10.2 *)
%o (Magma) &cat [[1, 2, 3, 1, 0]^^30]; // _Wesley Ivan Hurt_, Dec 26 2016
%o (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 Cf. A006968.
%K nonn,base
%O 1,2
%A _José de Jesús Camacho Medina_, Nov 17 2016