UVa100: 3n+1

uva exercise.