function hail_sequence ( n )

  n                    % Print the first value
   
  while ( n ~= 1 )
  
    if ( mod ( n, 2 ) == 0 )
      n = n / 2
    else
      n = 3 * n + 1
    end
    
  end
  
  return
end
