AP Computer Sci Recursion problem??

<p>public static int mystery(int n) {
if (n == 0)
return 1;
else return 3 * mystery(n - 1);
}
What value is returned as a result of the call mystery(5) ?
Theory behind my work:
since it asks what will be returned with mystery(5) I figured you just take the factorial of five and multiply it by the 3? Could someone try to explain the logic to these types of problems?
My work:
5! = 5 * 4! = 120
4! = 4 * 3! = 24
3! = 3 * 2! = 6
2! = 2</p>

<hr>

<p>So then 120 * 3 = 360</p>

<p>But the answer is 243, could anyone explain what I'm doing wrong?</p>

<p>mystery(0) = 1
=> mystery(1) = 3
=> mystery(2) = 9
=> mystery(3) = 27
=> mystery(4) = 81
=> mystery(5) = 243</p>

<p>There’s no factorial involved.</p>

<p>Wow, thanks a lot! That clarified it perfectly!</p>