# The Grand Exercise in Following Directions

This is not an original puzzle. This puzzle was created by a really cool TA at my summer math camp, for a puzzle hunt that was started in compensation for a cancelled math tournament. I just thought that it had a really cool concept and would be a nice addition to this community. I also don't remember the complete solution. :P

Here it is:

1. Mastered algebra? Pick a number, and see!
2. Uncomplicated for now: multiply by eighty-three
3. Log base four of your |result|
5. Increase your number by seventy more
6. Plus an additional fifteen, and take the floor
7. Less step thirteen's number: this part is the key!
8. Your next number's the ceiling of division by three
9. Base is two; exponent's your number squared
10. You now kill the fractional part; the integer part's spared
11. 3 is the next number to multiply by
12. Made it this far? Wow, I'm surprised!
13. Obtain a new number by squaring the last
14. Delete the last digit (this step should be fast)
15. 1 is a digit that (to the back) you append
16. 7 you'll add... could this be the end?

Hint?

I can confirm that the order in which my team followed the directions was seriously messed up. I'm also rather sure it had everything to do with the secret message.

• If this puzzle is anything like "giraffe/elephant in the refrigerator," steps 5's and 9's "your number" might refer to step 1's "pick a number" or step 8's "your next number" – humn Oct 25 '16 at 3:47
• I definitely don't think it was that. – greenturtle3141 Oct 25 '16 at 4:13

OK, here goes. No spoilers on the first bit because that would just be too much hassle.

1. $x$
2. $83x$
3. $\log_4(83x)$
4. $\log_4(83x)+a$
5. $\log_4(83x)+a+70$
6. $\lfloor\log_4(83x)+a+85\rfloor$
7. $\lfloor\log_4(83x)+a+85\rfloor-y$
8. $\left\lceil\frac{\lfloor\log_4(83x)+a+85\rfloor-y}{3}\right\rceil$
9. $2^{\left\lceil\frac{\lfloor\log_4(83x)+a+85\rfloor-y}{3}\right\rceil^2}$
10. same (this is $2^n$ where $n$ is a non-negative integer)
11. $3\cdot2^{\left\lceil\frac{\lfloor\log_4(83x)+a+85\rfloor-y}{3}\right\rceil^2}$
12. same
13. $9\cdot2^{2\left\lceil\frac{\lfloor\log_4(83x)+a+85\rfloor-y}{3}\right\rceil^2}$; this has to equal $y$
14. $\left\lfloor\frac{9\cdot2^{2\left\lceil\frac{\lfloor\log_4(83x)+a+85\rfloor-y}{3}\right\rceil^2}}{10}\right\rfloor$
15. $10\left\lfloor\frac{9\cdot2^{2\left\lceil\frac{\lfloor\log_4(83x)+a+85\rfloor-y}{3}\right\rceil^2}}{10}\right\rfloor+1$ (note: there's another way to interpret this step; see below.)
16. $10\left\lfloor\frac{9\cdot2^{2\left\lceil\frac{\lfloor\log_4(83x)+a+85\rfloor-y}{3}\right\rceil^2}}{10}\right\rfloor+8$

Note further that

the initial letters of the steps spell out MULTIPLY BY 3 MOD 17, which perhaps we are supposed to do at the end (though I kinda object: the result of doing that is an integer mod 17, not an integer, and cannot uniquely determine a room number unless there are very few rooms).

Our number $y$ (the result of step 13) is of the same order of magnitude as the final result (very close if "back" in step 15 means the right end; about the same number of digits, at any rate, if it means the left end), which is "a room number"; it is $9\cdot2^{2m^2}$ for some non-negative integer $m$. That is, it is one of: 9, 36, 2304, 2359296, etc. It turns out (though I don't think it particularly matters) that the values 9 and 36 are not possible if $x$ is an integer, because then the result of step 7 has to be large and we get a big value of $m$ that contradicts the small value of $y$.

Aside from that constraint,

let $m$ be any non-negative integer that's $\geq 2$ (this will be the number coming out of step 8). Then I claim that we can arrange for this number to emerge from step 8, and for everything to be consistent, and that each choice of $m$ yields a different final answer (before MULTIPLYing BY 3 MOD 17, anyway). I'll fix $a=18$ here. Then we need $\left\lceil\frac{\lfloor\log_4(83x)+103\rfloor-y}{3}\right\rceil=m$ where $y=9\cdot2^{2m^2}$. Since $m\geq2$, $y\geq2304$. So, we'll make $lfloor\log_4(83x)+103\rfloor-y=3m$ or equivalently $3m+y\leq\log_4(83x)+103\leq3m+y+1$ or $3m+y-103\leq\log_4(83x)\leq3m+y-102$ or $4^{3m+y-103}\leq83x\leq4^{3m+y-102}$. The difference between the lower and upper bounds here is at least $3\cdot4^{6+2304-103}$ which is much, much bigger than 83, so there is an $x$ for which this holds. Hence, we can make stage 8 produce the desired result. And now the final answer we obtain is $10\left\lfloor\frac{y}{10}\right\rfloor+8$ which changes whenever $y$ changes by more than 10. Recalling how $y$ depends on $m$, this is evidently true.

OK, so does it turn out that

the result after MULTIPLYing BY 3 MOD 17 doesn't change when $m$ does? Not quite. In fact the result mod 17 depends on the parity of $m$, because $y$ mod 170 depends only on the parity of $m$. (Proof: easy exercise.) So our final result after MULTIPLYing BY 3 MOD 17 is 5 if $m$ is even, and -5 (or, if you prefer, 12) if $m$ is odd.

So

either there is some other hidden step or constraint, or my calculations have gone astray somehow, or there isn't in fact a unique answer without extra assumptions like the one about the room number.

• I would like to note that we campers were not informed that the result would conveniently be a room number, although we did speculate it might happen to be. If I remember correctly, the youngest adult age we used was 18. Unfortunately, your approach is off track. – greenturtle3141 Oct 21 '16 at 22:23
• Do you mean there's an actual mistake in it? – Gareth McCaughan Oct 21 '16 at 22:34
• There is no mistake. – greenturtle3141 Oct 21 '16 at 22:34
• So, just to be clear, you're saying that I started with the question you asked, followed some reasoning in which "there is no mistake", and arrived at a definite answer, but none the less it's "off track"? If so, then perhaps the question needs to be clarified to make it more apparent that whatever I somehow did wrong without making mistakes is unacceptable... – Gareth McCaughan Oct 21 '16 at 22:36
• (Incidentally, you appear more confident than I am that there is no mistake in all the calculation above :-).) – Gareth McCaughan Oct 21 '16 at 22:36