Solution for 3n+1