Exemple #1
0
    static void Main(string[] args)
    {
        BigInteger[] nums = new BigInteger[100000000];
        Console.Write ("Número a analizar: ");
        BigInteger number = BigInteger.Parse(Console.ReadLine());

        collatz (number, nums);

        nums = nums.Where(val => val != 0).ToArray();

        foreach (BigInteger i in nums) {
            Console.Write ("{0} ", i);
        }

        Console.WriteLine ("\n\nSTEPS = {0}", nums.Length - 1);

        Console.Read ();
    }