Exemplo n.º 1
0
 protected override long GetCalculationResult()
 {
     var num = new LongNum("1");
     for (int i = 0; i <= 1000 - 1; i++)
     {
         num = num.Add(num);
     }
     this.Print("{0}", num);
     return num.DigitSum;
 }
Exemplo n.º 2
0
        protected override long GetCalculationResult()
        {
            var num = new LongNum("1");

            for (int i = 0; i <= 1000 - 1; i++)
            {
                num = num.Add(num);
            }
            this.Print("{0}", num);
            return(num.DigitSum);
        }
Exemplo n.º 3
0
        protected override long GetCalculationResult()
        {
            const int max = 1000;
            var       res = new LongNum(0);

            for (int i = 1; i <= max; i++)
            {
                res = res.Add(new LongNum(new LongNum(i).Pow(i).Last(10)));
            }

            var last = res.Last(10);

            Print("Digits: {0}", last);
            return(long.Parse(last));
        }
Exemplo n.º 4
0
        protected override long GetCalculationResult()
        {
            var     c       = 2;
            var     fib     = new LongNum("1");
            var     prevFib = new LongNum("1");
            LongNum ppFib;

            while (fib.Length < 1000)
            {
                c++;
                ppFib   = prevFib;
                prevFib = fib;
                fib     = fib.Add(ppFib);
                Print("{0,3} - {1,50}", c, fib);
            }

            return(c);
        }