Package io.github.skenvy
Class Collatz.HailstoneSequence
- java.lang.Object
-
- io.github.skenvy.Collatz.HailstoneSequence
-
-
Constructor Summary
Constructors Constructor Description HailstoneSequence(BigInteger initialValue, BigInteger p, BigInteger a, BigInteger b, int maxTotalStoppingTime, boolean totalStoppingTime)
Initialise and compute a new Hailstone Sequence.
-
-
-
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.
-
-