Talk:Euler problems/11 to 20 - Revision history
https://wiki.haskell.org/index.php?title=Talk:Euler_problems/11_to_20&action=history
Revision history for this page on the wikienMediaWiki 1.19.14+dfsg-1Sat, 03 Dec 2016 01:21:22 GMTKapil: Improvement to solution to Collatz problem in ProjectEuler
https://wiki.haskell.org/index.php?title=Talk:Euler_problems/11_to_20&diff=33403&oldid=prev
https://wiki.haskell.org/index.php?title=Talk:Euler_problems/11_to_20&diff=33403&oldid=prev<p>Improvement to solution to Collatz problem in ProjectEuler</p>
<p><b>New page</b></p><div>It seems to me that the solution posted to the Collatz problem is not<br />
the most efficient. In order to find integer that gives the longest chain<br />
it is not necessary to _find_ that longest chain. So one needs to use<br />
a Boolean function that merely checks whether the chain for n is<br />
longer than that for m where m is the winner so far.<br />
<br />
This does not need to repeatedly calculate the chain for m if we <br />
the tuple (m,c,m') where c is the length of the chain from m to m'<br />
which we have calculated so far.<br />
<br />
As far as I know the longest chain is significantly longer than all<br />
the other chains considered so this should save us a lot of time by<br />
avoiding computing that chain.</div>Sun, 31 Jan 2010 14:14:35 GMTKapilhttps://wiki.haskell.org/Talk:Euler_problems/11_to_20