The output of the programm is:
{\tt 15 12 22 8 16 11 23 21 3 5 1 17 10 7 24 19 20 18 9 14 4 2 13 6}.
So the last man is at position 15.
The statistics at the end of the run is:
{\tt 1879 instructions, 336 mems, 4350 oops; 341 good guesses, 81 bad}.

\def\tone{\lceil n/8\rceil}
\def\ttwo{\lfloor (D+n)/8\rfloor}
In general the program needs
$(5n+\tone+\ttwo+P-1)\mems + (27n+3\tone+6\ttwo+4P+72D+15)\oops$.
The value $P$ stands for $n-1$ count downs of $m-2$ steps, that is $P=(n-1)(m-2)$.
The quantity $D$ is the number of decimal digits in the output:
\def\tthree{\lfloor\log_{10}n\rfloor}
$$D=\sum_{i=0}^{\tthree-1} 9\cdot10^i + (\tthree+1)(n+1-10^{\tthree}).$$
In the case $n=24$, $m=11$ the values of $P$ and $D$ are $23\cdot9=207$ and
$9+2\cdot15=39$.
Therefore in this case the program would need $(120+3+7+207-1)\mems=336\mems$
and $(648+9+42+828+2808+15)\oops=4350\oops$ which agrees with the measured data.



