Also known as the 3n+1 problem on SPOJ