Nice simple solution.
1:49 is the same as seq(1, 49), so just use that instead for this exercise.
You can safely ignore the warning. It is just telling you that it has nothing to multiply the very last 0 by. The length of 1:49 is not a multiple of 2, which is the length of 1:0.
If you must use rep(), just repeating 1:0 25 times will give you a vector (1, 0, 1, 0, 1, 0, ...) with a length of 50. Unfortunately, you need it to be of length 49 to multiply by the 1 to 49 vector. There are several ways to subset a vector to keep only the first 49 elements. You can also look at the help for rep(), particularly length.out.