25.11.2014 Views

Explorations of the Collatz Conjecture - Moravian College

Explorations of the Collatz Conjecture - Moravian College

Explorations of the Collatz Conjecture - Moravian College

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

elif b mod 3 = 1 <strong>the</strong>n<br />

w:=floor((k-c)/2);<br />

# this is how many branchings will occur above b<br />

count:=count+w;<br />

if w>0 <strong>the</strong>n<br />

for s from 1 to w do<br />

count:=count+branchcount((b*(2ˆ(2*s))-1)/3,k,c+2*s);<br />

od;<br />

fi;<br />

elif b mod 3 = 2 <strong>the</strong>n<br />

v:=ceil((k-c)/2);<br />

count:=count+v;<br />

# this is how many branchings will occur above b<br />

if v>0 <strong>the</strong>n<br />

for r from 1 to v do<br />

count:=count+branchcount((b*(2ˆ(2*r-1))-1)/3,k,c+2*r-1);<br />

od;<br />

fi;<br />

fi;<br />

return(count);<br />

end:<br />

48

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!