PDA

View Full Version : Project Euler, 125



Lster
April 21st, 2008, 08:54 PM
Hi again everyone!

Project Euler is puzzling me again (and so soon after the last time), but this time it's problem 125.

http://projecteuler.net/index.php?section=problems&id=125

I am unable to find 11 palindromes, under 1000 that can be written as the sum of consecutive, positive squares.

... Snip...

Perhaps I have gone wrong in my reasoning or my implementation! Could anyone give me just a small hint. :)

Thank you,
Lster

WW
April 21st, 2008, 09:36 PM
Your code doesn't include the palindromes that are already in the list squaresum. If you include those (5 and 55), you get the correct result.

Lster
April 21st, 2008, 09:47 PM
Thanks! Another stupid mistake... Funnily enough, though, I am making excellent speed on Project Euler, though! :)

Lster
April 21st, 2008, 10:08 PM
Just to say, I've got the correct answer now! :)