February 18th, 2015, 9:31 pm
Elementary Programming Challenges or hereThe 3n + 1 ProblemConsider the following algorithm to generate a sequence of numbers. Start with an integer n. If n is even, divide by 2. If n is odd, multiply by 3 and add 1. Repeat this process with the new value of n, terminating when n = 1. For example, the following sequence of numbers will be generated for n = 22:22 11 34 17 52 26 13 40 20 10 5 16 8 4 2 1...From the Downloadable File extract/execute program ExSan.If you are using Avast Antivirus, please disable it for a while in order to allow ExSan create output files.

Attachments

 ExSan_V.5.02.A_3n_plus_one_problem.zip
 (2.45 MiB) Downloaded 82 times
Last edited by
ExSan on February 18th, 2015, 11:00 pm, edited 1 time in total.