Hi there,
Since you're asking in terms of programming, I would suggest something along the lines of:
my_max = 3
my_vec = c()
for( i in seq(1, my_max) ){
my_vec = append(my_vec, rep(i, i))
}
my_vec = rep(my_vec, my_max)
cat(my_vec, "\n")
print(my_vec)
Which will yield:
1 2 2 3 3 3 1 2 2 3 3 3 1 2 2 3 3 3
[1] 1 2 2 3 3 3 1 2 2 3 3 3 1 2 2 3 3 3
But, please note, that if this is homework, then to be frank, you may have a solution to your problem, but you have learned nothing. Learning to program is not just writing/obtaining the code, which solves the problem, but very much also learning to think "programmatically" 