I am trying to do a dynamic Collatz algorithm but seem to have incorrect answers beyond at least 626331 or greater. all of the others seem to be correct. ive been working on this for hours and cant figure out what my problem is. can anyone give me a suggestion to help. thanks
int DynamicCollatz::DynCollatzConjecture(__int64 n)
The maximum value generated by the Collatz algorithm for value 626331 is:
That number is tidily larger than will fit into a 32-bit (unsigned)
int. (Thecis the count of the steps taken to get to 1.)I used this
bcscript (which I have stashed away because the Collatz algorithm turns up on SO most years) to deduce that information: