Why don't you just type it in to an editor in your language of choice, compile it and run? I chose Java but that's just because I'm between CygWin installs on my box at the moment - I'd much rather be using C :-)
public class testprog {
public static void mysterious(int x) {
if (x == 0) return;
System.out.print(x + " ");
mysterious(x-1);
mysterious(x-1);
}
public static void main(String args[]) {
mysterious(4);
}
}
This outputs the numbers:
4 3 2 1 1 2 1 1 3 2 1 1 2 1 1
Basically, what's happening is that, at each level, you print out the number then call the next level twice with the next lowest number (unless it's reached zero).
Aside: technically, you do call the next layer with zero but, since it returns straight away, it has no affect on the output.
The following diagram will hopefully illustrate this better, with different symbols representing different layers:
(4) (-------------------------------) (-------------------------------)
{3} {-----------} {-----------} {3} {-----------} {-----------}
[2] [1] [1] [2] [1] [1] [2] [1] [1] [2] [1] [1]
mysteriousin all their exam questions? :)