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-2 of 2 results.

A060109 Numbers in Morse code, with 1 for a dot, 2 for a dash and 0 between digits/letters.

Original entry on oeis.org

22222, 12222, 11222, 11122, 11112, 11111, 21111, 22111, 22211, 22221, 12222022222, 12222012222, 12222011222, 12222011122, 12222011112, 12222011111, 12222021111, 12222022111, 12222022211, 12222022221, 11222022222, 11222012222, 11222011222, 11222011122, 11222011112, 11222011111
Offset: 0

Views

Author

Henry Bottomley, Feb 28 2001

Keywords

Examples

			a(10) = 12222022222 since 1 is ".----" and 0 is "-----".
		

Crossrefs

Cf. A059852 (Morse code for letters), A008777 (number of dots and dashes).
Cf. A060110 (these base-3 numbers converted to decimal), A321332 (duration of the code for n).

Programs

  • Haskell
    import Data.List (inits, tails)
    a060109 n = if n == 0 then 22222 else read (conv n) :: Integer where
       conv 0 = []
       conv x = conv x' ++ mCode !! d where (x', d) = divMod x 10
       mCode = map ('0' :) (mc ++ (reverse $ init $ tail $ map reverse mc))
       mc = zipWith (++) (inits "111111") (tails "22222")
    -- Reinhard Zumkeller, Feb 20 2015
    
  • Mathematica
    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 *)
  • 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

Formula

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

A059852 Consider the English alphabet in Morse code (the International Morse radio telegraph code). Map a 'dit' to the digit one and a 'dah' to the digit 2, then express that ternary number in decimal.

Original entry on oeis.org

5, 67, 70, 22, 1, 43, 25, 40, 4, 53, 23, 49, 8, 7, 26, 52, 77, 16, 13, 2, 14, 41, 17, 68, 71, 76
Offset: 1

Views

Author

Robert G. Wilson v, Feb 27 2001

Keywords

Comments

Written in base 3, the terms read (12, 2111, 2121, 211, 1, 1121, 221, 1111, 11, 1222, 212, 1211, 22, 21, 222, 1221, 2212, 121, 111, 2, 112, 1112, 122, 2112, 2122, 2211). This contains all words over {1,2} with 1 to 4 letters except for 1122, 1212, 2221 and 2222, which correspond to the codes for Ü, Ä, Ö and CH. - M. F. Hasler, Jun 22 2020

Examples

			The sixth letter, F, is ".._." in Morse. This becomes 1121 in ternary and 43 in decimal, so a(6) = 43.
		

References

  • "Learning the Radiotelegraph Code," Seventh Edition, published by American Radio Relay League, West Hartford 7, Connecticut, 1955.
  • "Morse Code Course," Jeppesen and Company, Denver, Colorado, 1962.
  • "International Morse Code," prepared by Lt. Commander F.R.L. Tuthill, USNR and Lt. (J.G.) E.L. Battey, USNR, published by Insuline Corporation of America, Long Island City, NY.

Crossrefs

Cf. A060110, the same for numbers, and A060109, written in base 3.
Cf. A008777 (number of base 3 digits = dots and dashes in the n-th letter), A281015, A281017, A281018.
Cf. A105386, A105387 (ambiguous variants using digits 0 and 1).

Programs

  • PARI
    A059852=digits(3008707498660932665486381130661318784490079420090,81) \\ or vecextract(apply(A032924,[1..28]), i) with i=numtoperm(26, 58849338891424664724588744) or i=vecsort(Vec("ETIANMSURWDKGOHVFuLaPJBXCYZQ"),,1)[1..26]. - M. F. Hasler, Jun 22 2020

Extensions

Edited, links and crossrefs added by M. F. Hasler, Jun 22 2020
Showing 1-2 of 2 results.