I have a 1×300 vector and would like to make it into a 1×400 vector by inserting a 0 after every third element, a 0 after every sixth element and a 1 after the ninth element and then after the twelfth element insert a 0 and repeat the pattern.

So for example if I have

0 0 1 0 1 0 1 0 0

this would become

0 0 1 0 0 1 0 0 1 0 0 1

and so on.

## Best Answer