Class Collatz.HailstoneSequence

  • Enclosing class:
    Collatz

    public static final class Collatz.HailstoneSequence
    extends Object
    Contains the results of computing a hailstone sequence via Collatz.hailstoneSequence(~).
    • Constructor Detail

      • HailstoneSequence

        public HailstoneSequence​(BigInteger initialValue,
                                 BigInteger p,
                                 BigInteger a,
                                 BigInteger b,
                                 int maxTotalStoppingTime,
                                 boolean totalStoppingTime)
                          throws Collatz.FailedSaneParameterCheck
        Initialise and compute a new Hailstone Sequence.
        Parameters:
        initialValue - The value to begin the hailstone sequence from.
        p - Modulus used to devide n, iff n is equivalent to (0 mod P).
        a - Factor by which to multiply n.
        b - Value to add to the scaled value of n.
        maxTotalStoppingTime - Maximum amount of times to iterate the function, if 1 is not reached.
        totalStoppingTime - Whether or not to execute until the "total" stopping time (number of iterations to obtain 1) rather than the regular stopping time (number of iterations to reach a value less than the initial value).
        Throws:
        Collatz.FailedSaneParameterCheck - if P or a are 0.