An annoyed teacher asked her student to do the following:
(1) Start with the number 12. Go to step (2). (2) Take the negative of the number reached at the end of the previous step. Go to step (3). (3) Add 1 to the number reached at the end of the previous step. Go to step (4). (4) Go back to step (2) unless you have already gone through step (3) a hundred times; if you have gone through step (3) a hundred times already, tell the teacher the last number you reached.
To the teacher's surprise, the student gave her the correct final answer within a minute. What was it?
12, -12, -12+1=-11 Following the steps leads me to think that on an odd number of turns you get -11 and on an even number of turns you get 12. Since it asked for 100 times, then the answer should be 12. What do we think?
Let $f(x) = -x + 1$. Then $f(f(x)) = -(-x+1)+1=x$, so $f(f(f(x)))=f(x)$. In general, if $n$ (even) is the number of times we evaluate the function at itself, then $f_n(x)=f(x)$ and $f_n(x) = x$ if $n$ is odd. So you're correct, and the answer asked is $f_{100}(12) = 12.$