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.

A280916 Number of dashes in International Morse numeral representation of n.

This page as a plain text file.
%I A280916 #28 May 01 2021 08:04:04
%S A280916 5,4,3,2,1,0,1,2,3,4,9,8,7,6,5,4,5,6,7,8,8,7,6,5,4,3,4,5,6,7,7,6,5,4,
%T A280916 3,2,3,4,5,6,6,5,4,3,2,1,2,3,4,5,5,4,3,2,1,0,1,2,3,4,6,5,4,3,2,1,2,3,
%U A280916 4,5,7,6,5,4,3,2,3,4,5,6,8,7,6,5,4,3,4,5,6,7,9,8,7,6,5,4,5,6,7,8,14
%N A280916 Number of dashes in International Morse numeral representation of n.
%C A280916 The Morse Code is written in current ITU standard.
%H A280916 Indranil Ghosh, <a href="/A280916/b280916.txt">Table of n, a(n) for n = 0..10000</a>
%H A280916 Wikipedia, <a href="http://en.wikipedia.org/wiki/Morse_code">Morse code</a>
%H A280916 Wikipedia, <a href="https://en.wikipedia.org/wiki/International_Telecommunication_Union">International Telecommunication Union</a>
%F A280916 a(n) = A316863(A060109(n)) = floor(1+n/10)*5 - A280913(n) = a(floor(n/10)) + a(n%10) if n > 9 or |5 - n| otherwise, where % is the modulo (remainder) operator. - _M. F. Hasler_, Jun 22 2020
%e A280916 For n = 4, the Morse numeral representation of 4 is "....-" i.e., 1 dash. So, a(4) = 1.
%e A280916 For n = 26, the Morse numeral representation of 26 is "..--- -...." i.e, 4 dashes. So, a(26) = 4.
%t A280916 Array[Total@ Map[Abs[# - 5] &, IntegerDigits[#]] &, 101, 0] (* _Michael De Vlieger_, Jun 28 2020 *)
%o A280916 (Python)
%o A280916 M={"1":".----","2":"..---","3":"...--","4":"....-","5":".....","6":"-....","7":"--...","8":"---..","9":"----.","0":"-----"}
%o A280916 def A280916(n):
%o A280916     z="".join(M[i] for i in str(n))
%o A280916     return z.count("-")
%o A280916 print([A280916(n) for n in range(100)])
%o A280916 (PARI) apply( {A280916(n)=if(n>9, self()(n\10)+self()(n%10), abs(n-5))}, [0..88]) \\ _M. F. Hasler_, Jun 22 2020
%Y A280916 Cf. A060109 (Morse code of n), A280913 (number of dots).
%Y A280916 Cf. A006968, A278182 (for Roman resp. Maya representation of n).
%K A280916 nonn,base
%O A280916 0,1
%A A280916 _Indranil Ghosh_, Jan 10 2017