Class PE0044

    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) java.util.ArrayList<java.lang.Long> pentagons
      A storage for all found pentagon numbers.
    • Constructor Summary

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

      Modifier and Type Method Description
      void prepare()
      It just initializes the pentagons list.
      java.lang.String solve()
      This method solves the given problem by calculating one pentagon number after each other.
      • Methods inherited from class java.lang.Object

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

      • pentagons

        java.util.ArrayList<java.lang.Long> pentagons
        A storage for all found pentagon numbers.
    • Constructor Detail

      • PE0044

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

      • solve

        public java.lang.String solve()
        This method solves the given problem by calculating one pentagon number after each other. Every number is tested with all other found numbers. If the sum AND the difference of two pentagon number is another one the difference is stored. A loop runs until the difference of two consecutive is larger than the minimum found difference.
        Returns:
        the smallest difference of two pentagon numbers that is a pentagon number, two