The seq function in R would give me a sequence from x to y with a constant step m:
seq
x
y
m
seq(x, y, m)
First n terms of this sequence you can generate with
n
x = 1; m1 = 2; m2 = 4 n <- 0:10 # first 11 terms x + ceiling(n/2)*m1 + ceiling((n-1)/2)*m2 # [1] 1 3 7 9 13 15 19 21 25 27 31