Example #1
0
        public static LychrelCandidate ProcessLychrelCandidate(LychrelCandidate c)
        {
            bool isNotLychrel = false;
            int count = 0;
            BigInteger n = c.Number;

            while (!isNotLychrel && count < c.MaxIterations) {
                n = AddReverse (n);
                isNotLychrel = IsPalindrome (n.ToString ());
                count++;
            }
            return new LychrelCandidate (c.Number, c.MaxIterations, count, isNotLychrel, n.ToString ());
        }
Example #2
0
        public static LychrelCandidate ProcessLychrelCandidate(LychrelCandidate c)
        {
            bool       isNotLychrel = false;
            int        count        = 0;
            BigInteger n            = c.Number;

            while (!isNotLychrel && count < c.MaxIterations)
            {
                n            = AddReverse(n);
                isNotLychrel = IsPalindrome(n.ToString());
                count++;
            }
            return(new LychrelCandidate(c.Number, c.MaxIterations, count, isNotLychrel, n.ToString()));
        }
Example #3
0
 public static void Display(LychrelCandidate c)
 {
     Console.WriteLine (c.Number + " " + c.IterationsDone + " " + c.Result);
 }
Example #4
0
 public static void Display(LychrelCandidate c)
 {
     Console.WriteLine(c.Number + " " + c.IterationsDone + " " + c.Result);
 }