Remove the second number from every group of three numbers
You want to skip every number of the form 3k+1? Then say that, using a generator expression.

print(' '.join(str(i) for i in range(30) if i % 3 != 1))