I just head about this problem yesterday from a work colleague. Here’s wikipedia reference: http://en.wikipedia.org/wiki/Collatz_conjecture

I was intrigued so plotted the problem. I plotted 3x+1 and x/2. Then, since we’re using a recursive feature, I plotted y = x.

So, we start with a random number for x, say, 3. The function 3x+1 returns 10, we reflect 10 to the y=x line and because it’s even, we reflect it down to the x/2 line and that returns 5. We reflect 5 to the y=x line but since it’s odd, we reflect it up to the 3x+1 line and that returns 16. We reflect 16 to the y=x line and because it’s even, we reflect it down to the x/2 line. That returns 8. We reflect that to the y=x line and because it’s even, it goes to the x/2 line, which returns 4. All the subsequent numbers are even and so the reflection finally falls to 1. Here’s a quick and dirty graph: