The sequence can be described as follows:

Consider the rth term (r starts from 0).

If r is even, .

If r is odd, .

So, we need to subtract 1 from 3r+1 if r is even and add 1 to 3r+1 if r is odd. An easy way to do this would be to add to 3r+1.

Thus, we find that the general term is given by .