Class Hart_Squarefree


  • public class Hart_Squarefree
    extends FactorAlgorithm
    A variant of Hart's one line factorizer using k = 315 * s, where s is squarefree (1,2,3,5,6,7,10,11,13,...). For semiprimes having smaller factor >= cbrt(N) this seems to be the fastest algorithm for N from 23 to 35 bits.
    • Constructor Detail

      • Hart_Squarefree

        public Hart_Squarefree​(boolean doTDivFirst)
        Full constructor.
        Parameters:
        doTDivFirst - If true then trial division is done before the Lehman loop. This is recommended if arguments N are known to have factors < cbrt(N) frequently.
    • Method Detail

      • getName

        public String getName()
        Specified by:
        getName in class FactorAlgorithm
        Returns:
        The name of the algorithm, possibly including important parameters.
      • findSingleFactor

        public long findSingleFactor​(long N)
        Find a factor of long N.
        Parameters:
        N -
        Returns:
        factor of N
      • main

        public static void main​(String[] args)
        Test.
        Parameters:
        args - ignored