Q:

Iterate through numbers using seq() and rep()

I need to use rep() and seq() to get the following vector: 
1 2 3 4 5 2 3 4 5 6 3 4 5 6 7 4 5 6 7 8 5 6 7 8 9 

Normally I would just use a for statement to achieve this but I am restricted from using that and can only use rep() and seq() to achieve this vector.

A:

> 1:5 + rep(0:4, each=5)
 [1] 1 2 3 4 5 2 3 4 5 6 3 4 5 6 7 4 5 6 7 8 5 6 7 8 9

