find longest hailstone sequence recursively in swift