For the fifth hole of
's golf course, he would like you to examine the Collatz Conjecture.The Collatz Conjecture is based on a series of operations applied on a number, as described by the function below:
It is conjectured that if this function applied over and over again for any positive integer, it would eventually converge to (and then repeat a cycle of
).
You are to write a program to follow the process described above on all numbers from to
inclusive. For each number from
to
inclusive, your program should output the sum of all the numbers it reaches (including the starting number) before it reaches
.
For example, if was the starting number, the process would proceed as follows:
Starting with , your program should output
.
Input Specification
There is no input.
Output Specification
Your program should output all sums for this process starting with the numbers from
to
inclusive, on a single line separated each by a single space.
More specifically, the output should be (on a single line):
0 2 48 6 35 54 287 14 338 45 258 66 118 301 693 30 213 356 518 65 147 280 632 90 657 144 101439 329 441 723 101103 62 840 247 539 392 534 556 2343 105 101330 189 1337 324 496 678 100978 138 805 707
Scoring
If the program has the correct output, you will receive a score of:
if the length of the code in bytes exceeds
if the length of the code in bytes is less than
where
is the length of code in bytes, if
Comments