while (n > 1) { if (n is even) n := n / 2 else n := 3 * n + 1 }The program goes through the sequence 5, 16, 8, 4, 2, 1; it will halt with 1 in R0.
(This is a very interesting algorithm and I'd encourage you to write it in a high-level language of your choice, with a print statement each loop iteration, and investigate its behaviour a bit. It is an unsolved problem whether or not this algorithm terminates for all n!)