solution to 3n+1 problem