Class PE0026

    • Constructor Summary

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

      Modifier and Type Method Description
      private int getCycle​(int d)
      Divides 1 by the given number step by step checking if the current remainder (modulus) was found earlier.
      java.lang.String solve()
      Solves the problem by decrementing D beginning from 1000.
      • Methods inherited from class java.lang.Object

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

      • PE0026

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

      • solve

        public java.lang.String solve()
        Solves the problem by decrementing D beginning from 1000. The loop stops when the looping variable is smaller than the biggest cycle found.
        Returns:
        the number with the biggest cycle
      • getCycle

        private int getCycle​(int d)
        Divides 1 by the given number step by step checking if the current remainder (modulus) was found earlier.
        Parameters:
        d - the number to be checked
        Returns:
        the length of the cycle