To solve this, compute mystery(1) then mystery(2) then mystery(3) and finally mystery(4).

  mystery(1) = 1
  mystery(2) = 3*mystery(1) = 3
  mystery(3) = 3*mystery(2) = 9
  mystery(4) = 3*mystery(3) = 27