[CSC 330] Turning Attention to Collatz
Andrew J. Pounds
pounds_aj at mercer.edu
Mon Nov 27 13:38:27 EST 2023
For those of you turning your attention to collatz, I really encourage
you to take a look at the Online Encyclopedia of Integer Sequences.
https://oeis.org/A006577
and then run your program on the interval 1-72 to see if you are
producing the correct output. Remember that if two integers have the
same collatz sequence length, you keep the smaller integer in your
list. When I run my code using those limits I produce the following...
Sorted based on sequence length
54 112
27 111
41 109
62 107
31 106
47 104
71 102
39 34
57 32
43 29
Sorted based on integer size
71 102
62 107
57 32
54 112
47 104
43 29
41 109
39 34
31 106
27 111
I could potentially run you programs with a really big ranges or really
big numbers (largest being 2100000000).
--
*Andrew J. Pounds, Ph.D.*
/Professor of Chemistry and Computer Science/
/Director of the Computational Science Program/
/Mercer University, Macon, GA, 31207 (478) 301-5627 /
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://theochem.mercer.edu/pipermail/csc330/attachments/20231127/7b0b855b/attachment.html>
More information about the csc330
mailing list