Class PE0035

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.ArrayList<java.lang.Integer> candidates
      List of all primes less that 1,000,000.
      private java.util.ArrayList<java.lang.Integer> found
      Stores all primes that are a solution of this problem.
      private java.util.ArrayList<java.lang.Integer> tested
      Storage of all tested primes.
    • Constructor Summary

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

      Modifier and Type Method Description
      void prepare()
      Just initializes the attributes and stores all primes less than 1,000,000 in candidates if the do not have one of the digits 0, 2, 4, 6, or 8.
      java.lang.String solve()
      This method solves the given problem by checking every prime in the list of candidates.
      • Methods inherited from class java.lang.Object

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

      • candidates

        private java.util.ArrayList<java.lang.Integer> candidates
        List of all primes less that 1,000,000.
      • tested

        private java.util.ArrayList<java.lang.Integer> tested
        Storage of all tested primes.
      • found

        private java.util.ArrayList<java.lang.Integer> found
        Stores all primes that are a solution of this problem.
    • Constructor Detail

      • PE0035

        public PE0035()
        A simple constructor to set number and title.
    • Method Detail

      • prepare

        public void prepare()
        Just initializes the attributes and stores all primes less than 1,000,000 in candidates if the do not have one of the digits 0, 2, 4, 6, or 8.
        Specified by:
        prepare in interface Solvable
        Overrides:
        prepare in class Problem
        See Also:
        Sieve
      • solve

        public java.lang.String solve()
        This method solves the given problem by checking every prime in the list of candidates. Therefore the current prime is rotated over the complete length. Only if all resulting number are prime the set is stored in found list.
        Returns:
        the size of found
        See Also:
        Mathe.rotate(int)