title: Get a seq() in R with alternating steps
body: <p>The <code>seq</code> function in R would give me a sequence from <code>x</code> to <code>y</code> with a <em>constant</em> step <code>m</code>:</p>
  
  <pre><code>seq(x, y, m)
  </code></pre>
  
  <p>E.g. <code>seq(1,9,2) = c(1,3,5,7,9)</code>.</p>
  
  <p>What would be the most elegant way to get a sequence from <code>x</code> to <code>y</code> with <em>alternating</em> steps <code>m1</code> and <code>m2</code>, such that something like <code>"seq(x, y, c(m1, m2))"</code> would give me <code>c(x, x + m1, (x + m1) + m2, (x + m1 + m2) + m1, ..., y)</code>, each time adding one of the steps (not necessarily reaching up to <code>y</code>, of course, as in <code>seq</code>)?</p>
  
  <p>Example: <code>x = 1; y = 19; m1 = 2; m2 = 4</code> and I get <code>c(1,3,7,9,13,15,19)</code>.</p>