Items tagged with collatz

Hi everybody,

The Collatz conjecture can be used to give students a taste of a topic in Number Theory.  See the Wikipedia article for a good explaination.

https://en.wikipedia.org/wiki/Collatz_conjecture

Also, a conjecture is something that is probrably true.  Enjoy my little Maple procedure.  (in .mw and .pdf forms)

Collatz_third_time.mw

Collatz_third_time.pdf

Comments are appreciated.

Matt

 

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 ?

 

checkCollatzValue:=proc(val) local res, remaining;
while res <> 1 do
remaining = irem(val, 2); remaining;
if remaining = 0 then res = val / 2; else res = val * 3 + 1; fi;
res;
od;
end proc;

Page 1 of 1