Personal tools

Talk:Euler problems/41 to 50

From HaskellWiki

Jump to: navigation, search

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)