Help Find A Sequence With The Property s(i) < s(i+1) XOR s(i+1) < s(i+2)

24 Views Asked by At

I'm looking for a sequence of positive integers with the property that, where $s(i)$ denotes the $i$th term, $s(i)<s(i+1)$ or $s(i+1)<s(i+2)$ but not both. The sequence also has the property that $s(i)=s(j)$ iff $i=j$. An OEIS number would be ideal.

1

There are 1 best solutions below

2
On BEST ANSWER

There are many such sequences; you merely have that it alternates increasing a decreasing and is injective. The example $$s(n)=n-(-1)^n$$ which starts $2,1,4,3,6,5,\ldots$ satisfies this.