This function checks for the Collatz conjecture for a given number. It can be customized to check other variants different to 3n+1. Takes a number n. If it’s even, divide by 2. If it’s odd, multiply by 3 and add 1. Repeat. Do all starting numbers lead to 1?
n A positive real number greater than 2.
modNum Modulus number, default modNum = 2
multFac Multiplication factor, default multFac = 3
addSum Sumand to add, default addSum = 1
nStop stop after nStop steps (avoid infinite loop)
default nStop = 1000
n Final value (n=1)
______________________________________________________________________________
Copyright (C) 2019 Edgar Guevara, PhD
______________________________________________________________________________