Пример #1
0
 public AliquotChainLink(IPrimes p, BigInteger n)
 {
     Current = n;
       try
       {
     Factorisation = new PrimeFactorisation(p, Current);
     Successor = Factorisation.SumAllProperDivisors();
       }
       catch(Exception e)
       {
     Exception = e;
       }
 }
Пример #2
0
 private static string CalcColor(BigInteger current, PrimeFactorisation factorisation)
 {
     if(factorisation.FactorsAndPowers.Count == 1)
       {
     if(factorisation.FactorsAndPowers[0].Power == 1)
     {
       return "black";
     }
       }
       if (factorisation.IsSquare)
       {
     return "blue";
       }
       if (factorisation.Driver().Length > 0)
       {
     return "orange";
       }
       if(current % 2 == 0)
       {
     return "red";
       }
       return "green";
 }
Пример #3
0
 public AliquotChainLink(BigInteger current, BigInteger successor, PrimeFactorisation factorisation)
 {
     Current = current;
       Successor = successor;
       Factorisation = factorisation;
 }