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.
%I A093796 #32 Feb 16 2025 08:32:53 %S A093796 1,1,1,1,1,1,1,5,5,5,1,5,1,1,5,1,1,1,1,10,10,10,1,10,1,1,10,1,1,1,10, %T A093796 1,5,10,5,10,5,1,10,5,1,1,10,5,1,1,1,10,1,10,10,10,10,10,1,10,10,1,1, %U A093796 10,10,1,1,1,10,10,1,5,10,10,5,10,10,5,1,10,10,5,1 %N A093796 Sequence of digit-values after concatenating the natural numbers < 4000 in Roman numeral representation. %C A093796 In other words, read the sequence of Roman numerals of natural numbers without spaces: I II III IV V VI VII VIII IX, ..., replacing I by 1, V by 5, X by 10, etc. %D A093796 GCHQ, The GCHQ Puzzle Book, Penguin, 2016. See Question 300(b), page 199. %H A093796 Nathaniel Johnston, <a href="/A093796/b093796.txt">Table of n, a(n) for n = 1..30000</a> (complete up to 3999) %H A093796 Stephanus Gibbs, <a href="http://www.softhawkway.com/rcalc.htm">Roman Numeral and Date Conversion</a> %H A093796 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/RomanNumerals.html">Roman Numerals</a> %e A093796 I,II,III,IV,V,VI,VII,VIII,IX,X,XI,XII, ... %e A093796 I,(I,I),(I,I,I),(I,V),V,(V,I),(V,I,I),(V,I,I,I),(I,X), ... %e A093796 1,(1,1),(1,1,1),(1,5),5,(5,1),(5,1,1),(5,1,1,1),(1,10), ... %e A093796 1,1,1,1,1,1,1,5,5,5,1,5,1,1,5,1,1,1,1,10,10,10,1,10,1,1, ... %p A093796 for n from 1 to 50 do r:=convert(n, roman): for j from 1 to length(r) do printf("%d, ", convert(r[j],arabic)): od: od: # _Nathaniel Johnston_, May 18 2011 %t A093796 A093796full = Flatten[FromRomanNumeral[Characters[RomanNumeral[Range[3999]]]]]; %t A093796 A093796full[[;;100]] (* _Paolo Xausa_, Mar 03 2024 *) %o A093796 (Haskell) %o A093796 import Data.List (unfoldr) %o A093796 a093796 n = a093796_list !! n %o A093796 a093796_list = concatMap (reverse . unfoldr r) $ map a061493 [1..3999] %o A093796 where r 0 = Nothing %o A093796 r x = Just ([0,1,5,10,50,100,500,1000] !! fromInteger d, x') %o A093796 where (x', d) = divMod x 10 %o A093796 -- _Reinhard Zumkeller_, Apr 14 2013 %o A093796 (Python) %o A093796 def f(s, k): %o A093796 return s[:2] if k==4 else (s[1]*(k>=5)+s[0]*(k%5) if k<9 else s[0]+s[2]) %o A093796 def r(n): %o A093796 m, c, x, i = n//1000, (n%1000)//100, (n%100)//10, n%10 %o A093796 return "M"*m + f("CDM", c) + f("XLC", x) + f("IVX", i) %o A093796 def afull(): %o A093796 v = {"I":1, "V":5, "X":10, "L":50, "C":100, "D":500, "M":1000} %o A093796 ans = [] %o A093796 for i in range(1, 4000): ans.extend([v[d] for d in r(i)]) %o A093796 return ans %o A093796 print(afull()[:80]) # _Michael S. Branicky_, Mar 04 2024 %Y A093796 Cf. A007376. %Y A093796 Cf. A061493; A222581 (run lengths). %K A093796 nonn,base,easy,fini,full %O A093796 1,8 %A A093796 _Reinhard Zumkeller_, May 18 2004