You can write the function for the amount of caffeine in your system as:
c(t) = 145 * (1 - 0.12)^ (t) = 145 * (0.88)^t
Then, you want to find t when c(t) = 21
=> 21 = 145 * (0.88)^t
=> 21/145 = (0.88)^t
Which applyin logarithm properties => t * log (0.88) = log (21/145)
=> t = [log 21/145)] / [log 0.88)] = 15.11 hours ≈ 15 hours
Answer: 15 hours (rounded to the nearest whole hour)