Hailstone sequence computation