GO Solution For UVa 100 - The 3n + 1 problem. In this post we will see how we can solve this challenge in GoLang for UVa Online Judge.

Problem Description

Problems in Computer Science are often classified as belonging to a certain class of problems (e.g., NP, Unsolvable, Recursive). In this problem you will be analyzing a property of an algorithm whose classification is not known for all possible inputs.

Consider the following algorithm:

  1. input n
...

You can find the full details of the problem The 3n + 1 problem at UVa Online Judge

Sample Input

1 10
100 200
201 210
900 1000

Sample Output

1 10 20
100 200 125
201 210 89
900 1000 174

Solution: Please check the main.go snippet for the solution.

Solution originally posted at: Github by @codingsince1985