Collatz who? #2

The Collatz Procedure is f = If [ EvenQ [ $#$1 ] , $#$1 2 , 3 $#$1 + 1 ] & f=\text{If}\left[\text{EvenQ}[\text{\$\#\$1}],\frac{\text{\$\#\$1}}{2},3 \text{\$\#\$1}+1\right]\& or, in other words, one application of the procedure is if the number is even, then the result is division of the number by 2, otherwise the result of the procedure is multiply the number by 3 and then add 1 to the product. The procedure is normally applied to positive integers. In this problem, the procedure will only be applied to positive integers. Usually, if the procedure is applied to the previous result repetitively, then a 4-2-1 cycle will be reached. It is conceivable that some other cycle might be reached or the numbers will never reach a cycle of some sort.

This problem's question: For the starting integers from 1 to 99, including the starting integer and the 4-2-1 that ends the procedure, how many distinct values are reached?

Note 1: Since the starting integers are included and the ending 4.-2-1 members are part of that range, there are at least 99 entries in the set of integers reached. Any integer value is only counted once no matter how many times it occurs.

Note 2: This is a computation problem. A computer solution is acceptable.


The answer is 251.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

1 solution

The result of a computer computation is 251.

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...