title: Duplicate values in Julia with Function
body: <p>I need writing a function which takes as input</p>
  
  <pre><code>a = [12,39,48,36]
  </code></pre>
  
  <p>and produces as output</p>
  
  <pre><code>b=[4,4,4,13,13,13,16,16,16,12,12,12]
  </code></pre>
  
  <p>where the idea is to repeat one element three times or two times (this should be variable) and divided by 2 or 3.</p>
  
  <p>I tried doing this:</p>
  
  <pre><code>c=[12,39,48,36]
  a=size(c)
  for i in a 
      repeat(c[i]/3,3)
  end
  </code></pre>