MaplePrimes - Questions and Posts tagged with collatz
http://www.mapleprimes.com/tags/collatz
en-us2017 Maplesoft, A Division of Waterloo Maple Inc.Maplesoft Document SystemSun, 20 Aug 2017 17:22:36 GMTSun, 20 Aug 2017 17:22:36 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
https://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