The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A280913 Number of dots in International Morse numeral representation of n. 5

%I #28 May 01 2021 08:02:53

%S 0,1,2,3,4,5,4,3,2,1,1,2,3,4,5,6,5,4,3,2,2,3,4,5,6,7,6,5,4,3,3,4,5,6,

%T 7,8,7,6,5,4,4,5,6,7,8,9,8,7,6,5,5,6,7,8,9,10,9,8,7,6,4,5,6,7,8,9,8,7,

%U 6,5,3,4,5,6,7,8,7,6,5,4,2,3,4,5,6,7,6,5,4,3,1,2,3,4,5,6,5,4,3,2,1,2,3,4,5,6,5,4,3,2

%N Number of dots in International Morse numeral representation of n.

%C The Morse Code is written in current ITU standard.

%C For the number of dashes see A280916.

%H Indranil Ghosh, <a href="/A280913/b280913.txt">Table of n, a(n) for n = 0..10000</a>

%H Wikipedia, <a href="http://en.wikipedia.org/wiki/Morse_code">Morse code</a>

%H Wikipedia, <a href="https://en.wikipedia.org/wiki/International_Telecommunication_Union">International Telecommunication Union</a>

%F a(n) = A268643(A060109(n)) = floor(1+n/10)*5 - A280916(n) = a(floor(n/10)) + a(n%10) if n > 9 or min(n, 10-n) = 5 - |5 - n| otherwise, where % is the modulo (remainder) operator. - _M. F. Hasler_, Jun 22 2020

%e For n = 4, the Morse numeral representation of 4 is "....-" i.e., 4 dots. So, a(4) = 4.

%e For n = 26, the Morse numeral representation of 26 is "..--- -...." i.e, 6 dots. So, a(26) = 6.

%t Table[Total[IntegerDigits[n]/.{6->4,7->3,8->2,9->1}],{n,0,120}] (* _Harvey P. Dale_, Feb 06 2020 *)

%o (Python)

%o M={"1":".----","2":"..---","3":"...--","4":"....-","5":".....","6":"-....","7":"--...","8":"---..","9":"----.","0":"-----"}

%o def A280913(n):

%o z="".join(M[i] for i in str(n))

%o return z.count(".")

%o print([A280913(n) for n in range(101)])

%o (PARI) apply( {A280913(n)=if(n>9,self()(n\10)+self()(n%10), 5-abs(n-5))}, [0..88]) \\ _M. F. Hasler_, Jun 22 2020

%Y Cf. A060109 (Morse code for n), A280916 (number of dashes), A268643 (number of '1's in n).

%Y Cf. A006968, A278182.

%K nonn,base

%O 0,3

%A _Indranil Ghosh_, Jan 10 2017

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 20 17:58 EDT 2024. Contains 372720 sequences. (Running on oeis4.)