Class PrimeFactors



  • public class PrimeFactors
    extends Object
    Static methods related to prime factors.
    • Constructor Detail

      • PrimeFactors

        public PrimeFactors()
    • Method Detail

      • getPrimeNumbers

        public static long[] getPrimeNumbers(int arrayLength)
        Return the first several prime numbers.
        Parameters:
        arrayLength - the number of prime numbers to return.
        Returns:
        an array of the first several prime numbers.
      • get

        public static long[] get(long i)
                          throws MathException.NegativeException
        Return the prime factors a number. This caches data to a static look-up table.
        Parameters:
        i - a non-negative long value
        Returns:
        the prime factors for the argument
        Throws:
        MathException.NegativeException - if the argument is negative