Difference between revisions of "Talk:Euler problems/41 to 50"

From HaskellWiki
Jump to navigation Jump to search
(→‎Problem 44: new solution.)
 
Line 4: Line 4:
 
Feel free to delete this message if I'm missing something.
 
Feel free to delete this message if I'm missing something.
 
--[[User:Jmcdon10|Jmcdon10]] 20:58, 17 March 2012 (UTC)
 
--[[User:Jmcdon10|Jmcdon10]] 20:58, 17 March 2012 (UTC)
  +
  +
I have posted my solution which I think is more correct, again I'm open to criticism.
  +
--[[User:Jmcdon10|Jmcdon10]] 19:20, 18 March 2012 (UTC)

Latest revision as of 19:20, 18 March 2012

Problem 44

I think there's a mistake in Problem 44. It works in that it gives the right answer (I assume, didn't actually check), but to be guaranteed correct, the algorithm needs to move through the pairs in order of the magnitude of their difference, which it seems to definitely not. For example, I believe it would check (2,1), (3,1), (3,2)... where (3,2) is a smaller difference than (3,1). If (3,2) and (3,1) were both pairs that had a pentagonal difference and sum, this algorithm would return (3,1) which would be wrong.

Feel free to delete this message if I'm missing something. --Jmcdon10 20:58, 17 March 2012 (UTC)

I have posted my solution which I think is more correct, again I'm open to criticism. --Jmcdon10 19:20, 18 March 2012 (UTC)