Class PE0003

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private long num
      The given maximum number.
      private Sieve sieve
      The storage for the "Sieve of Eratosthenes".
      private int sqrtNum
      The square root of the given number
    • Constructor Summary

      Constructors 
      Constructor Description
      PE0003()
      A simple constructor to set number and title.
    • Method Summary

      Modifier and Type Method Description
      void prepare()
      Initializes the sieve with the maximum of sqrtNum.
      java.lang.String solve()
      Runs the algorithm of the "Sieve of Eratosthenes" and finally finds the largest prime factor.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • num

        private long num
        The given maximum number.
      • sqrtNum

        private int sqrtNum
        The square root of the given number
      • sieve

        private Sieve sieve
        The storage for the "Sieve of Eratosthenes".
        See Also:
        Sieve
    • Constructor Detail

      • PE0003

        public PE0003()
        A simple constructor to set number and title.