I need to get this list
{1,0,2,1,3,2,4,3,5,4,6,5,7,6,8,7,9,8}
with a very small code (< 30 characters) using Table and List functions.
On each step, either it
- subtracts 1 or
- adds 2
I have tried
Range[1,18] + Table[(-i)*2^n, {i, -1, 1}, {n, 0, 1}
because I want $i = -1$ while $n = 0$ and $i = 1$ while $n = 1$, but I don't know how to set it up in one line.
Table[(n+3Mod[n,2])/2-1,{n,18}]
$\endgroup$Table[Floor[n/2]-(-1)^n,{n,18}]
$\endgroup$