Given n, generate a sequence like this:
 `0, 0, 1, 0, 1, 2, ........, 0, 1, 2, 3, 4, 5, 6, ....n`

Let's say n=3, then the sequence should be:
 `0, 0, 1, 0, 1, 2, 0, 1, 2, 3`

I've tried using rep, but it only generates a fixed length, where as I need the sequence length to increase each time.