Class Lehman_Simple


  • public class Lehman_Simple
    extends FactorAlgorithm
    Simple implementation of Lehmans factor algorithm, following https://programmingpraxis.com/2017/08/22/lehmans-factoring-algorithm/, using fast inverse trial division. This implementation is pretty slow, but useful for illustrating the basic algorithm. It may fail for N>=47 bit where 4*k*N produces a long-overflow.
    Author:
    Tilman Neumann
    • Constructor Detail

      • Lehman_Simple

        public Lehman_Simple​(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)