We have a strip of paper. We can cut and fold it. Allowed operations is:
1 - folding in half, when right-hand side is bent downward;
2 - folding in half, when left-hand side is bent downward;
3 - cut all in the middle, and all right-hand side placed under the left;
4 - cut all in the middle, and all left-hand side placed under the right;
Suppose we had 3 operations: first we did 1, then 3 and 2 (1,3,2). So, our strip now has 16 pages. We enumerate all pages from the top, and after that we return strip to its initial state.
Numbers on the top side of strips are: 16,1,12,5,8,9,14,3.
Numbers on the other side of strips: 4,13,10,7,6,11,2,15
So we have sequence $a_n$: 16,1,12,5,8,9,14,3,4,13,10,7,6,11,2,15 and $a_{10}$=13
Question is: After 16 operations (3,1,2,1,3,1,2,2,3,1,2,3,3,1,2,4) find $a_{1000}$-?