A280913 Number of dots in International Morse numeral representation of n.
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, 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, 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
Offset: 0
Examples
For n = 4, the Morse numeral representation of 4 is "....-" i.e., 4 dots. So, a(4) = 4. For n = 26, the Morse numeral representation of 26 is "..--- -...." i.e, 6 dots. So, a(26) = 6.
Links
- Indranil Ghosh, Table of n, a(n) for n = 0..10000
- Wikipedia, Morse code
- Wikipedia, International Telecommunication Union
Crossrefs
Programs
-
Mathematica
Table[Total[IntegerDigits[n]/.{6->4,7->3,8->2,9->1}],{n,0,120}] (* Harvey P. Dale, Feb 06 2020 *)
-
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
-
Python
M={"1":".----","2":"..---","3":"...--","4":"....-","5":".....","6":"-....","7":"--...","8":"---..","9":"----.","0":"-----"} def A280913(n): z="".join(M[i] for i in str(n)) return z.count(".") print([A280913(n) for n in range(101)])
Formula
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
Comments