A function $f$ from the integers to the integers is defined as follows:
\[f(n) = \left\{
\begin{array}{cl}
n + 3 & \text{if $n$ is odd}, \\
n/2 & \text{if $n$ is even}.
\end{array}
\right.\]Suppose $k$ is odd and $f(f(f(k))) = 27.$  Find $k.$
Since $k$ is odd, $f(k) = k + 3.$  Then $k + 3$ is even, so
\[f(k + 3) = \frac{k + 3}{2}.\]If $\frac{k + 3}{2}$ is odd, then
\[f \left( \frac{k + 3}{2} \right) = \frac{k + 3}{2} + 3 = 27.\]This leads to $k = 45.$  But $f(f(f(45))) = f(f(48)) = f(24) = 12,$ so $\frac{k + 3}{2}$ must be even.  Then
\[f \left( \frac{k + 3}{2} \right) = \frac{k + 3}{4} = 27.\]This leads to $k = 105.$  Checking, we find $f(f(f(105))) = f(f(108)) = f(54) = 27.$

Therefore, $k = \boxed{105}.$
105
Level 2
Intermediate Algebra
Problem: A function $f$ from the integers to the integers is defined as follows:
\[f(n) = \left\{
\begin{array}{cl}
n + 3 & \text{if $n$ is odd}, \\
n/2 & \text{if $n$ is even}.
\end{array}
\right.\]Suppose $k$ is odd and $f(f(f(k))) = 27.$  Find $k.$
Solution:<|START_OF_LATENT|><|PRIOR_PREFIX|>To solve for \( k \), we start with the condition \( f(f(f(k))) = 27 \). Since \( k \) is odd, we apply the function \( f \) to \( k \):

1. Calculate \( f(k) \):
   Since \( k \) is odd, we use the first case of the function:
   \( f(k) = k + 3 \).

2. Next, we need to find \( f(f(k)) \):
   Since \( k + 3 \) is even (the sum of an odd number and an even number is even), we use the second case of the function:
   \( f(f(k)) = f(k + 3) = \frac{k + 3}{2} \).

3. Now, we calculate \( f(f(f(k))) \):
   We need to determine if \( \frac{k + 3}{2} \) is odd or even. Since \( k \) is odd, \( k + 3 \) is even, and thus \( \frac{k + 3}{2} \) is an integer. We check if \( \frac{k + 3}{2} \) is odd or even:
   - If \( k + 3 \equiv 0 \mod 4 \), then \( \frac{k + 3}{2} \) is even.
   - If \( k + 3 \equiv 2 \mod 4 \), then \( \frac{k + 3}{2} \) is odd.

   For the next step, we assume \( \frac{k + 3}{2} \) is even (as it simplifies our calculations). Thus, we apply the second case of the function again:
   \( f(f(f(k))) = f\left(\frac{k + 3}{2}\right) = \frac{\frac{k + 3}{2}}{2} = \frac{k + 3}{4} \).

4. Set the equation:
   We know \( f(f(f(k))) = 27 \), so we set up the equation:
   \( \frac{k + 3}{4} = 27 \).

5. Solve for \( k \):
   Multiply both sides by 4:
   \( k + 3 = 108 \).
   Subtract 3 from both sides:
   \( k = 105 \).

Thus, the value of \( k \) that satisfies the original condition is \( 105 \).<|END_OF_LATENT|> The final answer is $105$.