Say I have a sequence from 1 to (a+b)*q, I would like to select the 1st "a" elements and skip the following "b" elements and repeat. For example
a = 5; b = 4; q = 3
seq(1, (a+b)*q)
1:27
a <- c(1:5, 10:14, 19:23)
For sequences > 1000, it is hard to do it manually, so is there a way to with a code?