= Solution
Even and odd original positions become consecutive new positions:
``
evens :: Seq a -> Seq a
evens s v = map (`div` 2) (filter even (s v))
odds :: Seq a -> Seq a
odds s v = map (`div` 2) (filter odd (s v))
``
An occurrence at $2j$ belongs to `evens` at position $j$; one at $2j+1$ belongs to `odds` at position $j$. Thus the formulas preserve increasing position order and produce the specified finite examples. For infinite occurrence lists, filtering can search forever when no further position of the chosen parity exists. Consequently these otherwise direct formulas need not preserve <productivity> for every query.
Back to article page