title: Iterate through an array with nonconsecutive integers
body: <p>I'm writing a code that will call a function repeatedly for each value in the Fibonacci sequence. For instance, let's say I want to print the sequence number each iteration, but I also want to print it in iteration-number times in that particular iteration. I'll want my output to be</p>
  
  <p><code>1 1 22 333 55555 88888888 ...</code> and so on. </p>
  
  <p>Currently, I have a for-loop set up that creates an array with the Fibonacci sequence:</p>
  
  <pre><code>for(index = 0; index &lt; 10; index++)
  {
        fibonacci[index] = fibonacci[index] + fibonacci[index-1]+fibonacci[index-2];
  }
  </code></pre>
  
  <p>I'm not sure where to proceed from here. I've experimented with adding additional for-loops both inside and outside this one, but I'm coming up short. Primarily the problem lies within the fact that the loop can't take on the sequene's nonconsecutive values.</p>