The formula 2(n+1-3[(n+2)/3]), where [] means the integer part of the mixed number in the brackets, can be used. For example, when n=100 the formula becomes 2(101-3[102/3])=2(101-3×34)=2(101-102)=2(-1)=-2.
In words this means:
(1) For the nth term, add 2 to n and divide the result by 3, and ignore any remainder;
(2) Multiply the result from (1) by 3 and subtract 1;
(3) Subtract (2)’s result from n and double this difference. This is now the nth term.