A321332 Duration of Morse code representation of n.
19, 17, 15, 13, 11, 9, 11, 13, 15, 17, 39, 37, 35, 33, 31, 29, 31, 33, 35, 37, 37, 35, 33, 31, 29, 27, 29, 31, 33, 35, 35, 33, 31, 29, 27, 25, 27, 29, 31, 33, 33, 31, 29, 27, 25, 23, 25, 27, 29, 31, 31, 29, 27, 25, 23, 21, 23, 25, 27, 29, 33, 31, 29, 27, 25, 23, 25, 27, 29, 31, 35, 33, 31, 29, 27, 25, 27
Offset: 0
Examples
n = 10: dsDsDsDsDSDsDsDsDsD, with a(10) = 3*(2-1) + 4*2 + ((1*1 + 3*4) + (1*0 + 3*5)) = 3 + 8 + (1*1 + 3*9) = 39.
Links
- Wikipedia, Morse code
Programs
-
Mathematica
nd[n_] := 15 - 2 * If[n<5, n, 10-n]; a[n_] := Module[{d = IntegerDigits[n]}, 7 * Length[d] - 3 + Total[nd/@ d]]; Array[a, 100, 0] (* Amiram Eldar, Dec 04 2018 *)
Formula
a(n) = S(n) + s(n) + dD(n), where S(n) = 3*(nrdigits(n) - 1), with nrdigits(n) the number of digits of n, s(n) = 4*nrdigits(n), and dD(n) = Sum_{j=1.. nrdigits(n)} 1*nrd(d_j) + 3*nrD(dj) = 1*A280913(n) + 3*A280916(n), with nrd(dj) the number of dots of the code of the j-th digits of n, and nrD(dj) the number of dashes of the code of the j-th digits of n.
Comments