Try this one:
m must be > 0
n=m
do
if (n mod 2) <> 0 then n=3*n+1
else n=n/2
loop until n=1
Now prove that this will always end for any number > 0..
Good luck!
|
Results 1 to 14 of 14
Thread: Only the best!Threaded View
|
Click Here to Expand Forum to Full Width |