TITLE: folding $2^n$ numbers
QUESTION [5 upvotes]: A rectangular strip of paper 16 units long and 1 unit wide is divided into 16 unit squares. Starting at the left end of the strip, the integers from 1 to 16 are written in order, one in each square. The strip is then folded so that the right half completely covers the left half. This action is repeated until the strip is one unit long. At this point how squares are beneath the square that has 10 written on it?
  The order of folding 1-16 is:
  $$1\;2\;\;3\;4\;5\;6\;7\;8\;\;9\;10\;11\;12\;13\;14\;15\;16$$
  2 15 10 7 6 11 14 3 4 13 12 5 8 9 16 1

What is the pattern behind here? For the general case of any $2^n$, folding in this way always result in 2 at the top and 1 at the bottom in the end - but what determines the order of the numbers in between?

REPLY [2 votes]: We will proceed stepwise
All layers top to bottom
Step $1$:
$2$ layers
$16,15,...9$
$1,2,...8$
Step $2$:
$4$ layers
$8,7,6,5$
$9,10,11,12$
$16,15,14,13$
$1,2,3,4$
Step $3$:
$8$ layers
$4,3$
$13,14$
$12,11$
$5,6$
$8,7$
$9,10$
$16,15$
$1,2$
At this stage we have discovered a clear pattern
To fill step $3$ using step $2$,
We take the bottom left numbers (in this case $3,4$ becomes $4,3$ orientation flipped) as top most, then the pair above it $(13,14)$ and so on until we reach top left.
By this time the top of step $3$ is filled, and now for the bottom half,
Take top right pair (dont reverse, in this case $8,7$ remains $8,7$) and repeat until we reach bottom right.
Step $4$:
$16$ layers
By using the pattern discovered, I will just write down the order of the numbers
Since each layer at this stage will have only $1$ number, we only need to extract $1$ number, (in case $3$ we extracted $2$ at a time)
The order is:
$2,15,10,7,6,11,14,3,4,13,12,5,8,9,16,1$
Now to extend this algorithm to $2^n$ numbers. I will be using binary numbers here with $n$.
The order of the numbers can be constructed in the following way:
Let the binary of a number be $abcdefg.......$, where $a$ is the first binary digit
$a$ can be filled, top to bottom: in this way:
Start with $0,1$, reverse it, $1,0$, again reverse $0,1$ and so on
$b$ can be filled in the same way, start with $0101$, reverse $1010, and so on.
For $c$, start with $01010101$, reverse and repeat
Repeat this until the last column remains,
For the last column, start with $1$ and use the same pattern
Example:
For the case $n=4$
$a$ will be filled:
$0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0$
$b$ will be filled:
$0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0$
$c$ will be filled:
$0,1,0,1,0,1,0,1,1,0,1,0,1,0,1,0$
$d$ will be filled:
$1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0$ 
Now to make an ordered list, combine $abcd$
And we get :
$0001=1$
$1110=14$
$1001=9$
$0110=6$
$0101=5$
$1010=10$
$1101=13$
$0010=2$
$0011=3$
$1100=12$
$1011=11$
$0100=4$
$0111=7$
$1000=8$
$1111=15$
$0000=0$
And add $1$