some more collatz.rb functionality
converted collatz.rb to c