I hope to get a list whose elements decrease by $2$ or increase by $1$, in turn, until the last element is $0$. For instance, starting with $4$ the sequence would be {4, 2, 3, 1, 2, 0}
. If you gave me $5$ instead, the sequence would be {5, 3, 4, 2, 3, 1, 2, 0}
.
This is my current method:
i = 1;
NestWhileList[If[++i; EvenQ[i], # - 2, # + 1]&, 5, UnequalTo[0]]
{5, 3, 4, 2, 3, 1, 2, 0}
But I am not very satisfied with that intermediate variable i
. I would like to find other methods.