MaplePrimes - Questions and Posts tagged with collatz
http://www.mapleprimes.com/tags/collatz
en-us2017 Maplesoft, A Division of Waterloo Maple Inc.Maplesoft Document SystemFri, 26 May 2017 03:35:15 GMTFri, 26 May 2017 03:35:15 GMTThe most recent questions and posts on MaplePrimes tagged with collatzhttp://www.mapleprimes.com/images/mapleprimeswhite.jpgMaplePrimes - Questions and Posts tagged with collatz
http://www.mapleprimes.com/tags/collatz
Calculating Collatz's Conjecture
http://www.mapleprimes.com/questions/200538-Calculating-Collatzs-Conjecture-?ref=Feed:MaplePrimes:Tagged With collatz
<p>Hi everyone, I'm trying to print out Collatz's Conjecture's steps for any given value with the following code but it takes forever and prints nothing. Any idea on how I can get it working ?</p>
<p> </p>
<p>checkCollatzValue:=proc(val) local res, remaining;<br> while res <> 1 do<br> remaining = irem(val, 2); remaining;<br> if remaining = 0 then res = val / 2; else res = val * 3 + 1; fi;<br> res;<br> od; <br>end proc;</p><p>Hi everyone, I'm trying to print out Collatz's Conjecture's steps for any given value with the following code but it takes forever and prints nothing. Any idea on how I can get it working ?</p>
<p> </p>
<p>checkCollatzValue:=proc(val) local res, remaining;<br> while res <> 1 do<br> remaining = irem(val, 2); remaining;<br> if remaining = 0 then res = val / 2; else res = val * 3 + 1; fi;<br> res;<br> od; <br>end proc;</p>200538Thu, 19 Dec 2013 21:08:56 ZNotCamelCaseNotCamelCase