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 A060109 #18 Nov 03 2020 01:40:12 %S A060109 22222,12222,11222,11122,11112,11111,21111,22111,22211,22221, %T A060109 12222022222,12222012222,12222011222,12222011122,12222011112, %U A060109 12222011111,12222021111,12222022111,12222022211,12222022221,11222022222,11222012222,11222011222,11222011122,11222011112,11222011111 %N A060109 Numbers in Morse code, with 1 for a dot, 2 for a dash and 0 between digits/letters. %H A060109 Reinhard Zumkeller, <a href="/A060109/b060109.txt">Table of n, a(n) for n = 0..10000</a> %H A060109 Wikipedia, <a href="http://en.wikipedia.org/wiki/Morse_code">Morse code</a> %F A060109 a(n) A007089(A060110(n)) = a(floor(n/10))*10^6 + a(n%10) for n > 9 and a(n) = 33333 - a(n-5) for n%10 > 4, where % is the modulo (remainder) operator. - _M. F. Hasler_, Jun 22 2020 %e A060109 a(10) = 12222022222 since 1 is ".----" and 0 is "-----". %t A060109 With[{a = Association@ Array[# -> If[# < 6, PadRight[ConstantArray[1, #], 5, 2], PadRight[ConstantArray[2, # - 5], 5, 1]] &, 10, 0]}, Array[FromDigits@ Flatten@ Riffle[Map[Lookup[a, #] &, IntegerDigits[#]], 0] &, 25]] (* _Michael De Vlieger_, Nov 02 2020 *) %o A060109 (Haskell) %o A060109 import Data.List (inits, tails) %o A060109 a060109 n = if n == 0 then 22222 else read (conv n) :: Integer where %o A060109 conv 0 = [] %o A060109 conv x = conv x' ++ mCode !! d where (x', d) = divMod x 10 %o A060109 mCode = map ('0' :) (mc ++ (reverse $ init $ tail $ map reverse mc)) %o A060109 mc = zipWith (++) (inits "111111") (tails "22222") %o A060109 -- _Reinhard Zumkeller_, Feb 20 2015 %o A060109 (PARI) apply( {A060109(n)=if(n>9,self()(n\10)*10^6)+fromdigits([1+(abs(k-n%10)>2)|k<-[3..7]])}, [0..39]) \\ _M. F. Hasler_, Jun 22 2020 %Y A060109 Cf. A059852 (Morse code for letters), A008777 (number of dots and dashes). %Y A060109 Cf. A060110 (these base-3 numbers converted to decimal), A321332 (duration of the code for n). %K A060109 base,nonn %O A060109 0,1 %A A060109 _Henry Bottomley_, Feb 28 2001