Why Might My Palindrome Calculation Be Incorrect?

  • Thread starter Thread starter rwinston
  • Start date Start date
rwinston
Messages
36
Reaction score
0
Hi all

I was looking q # 4 on ProjectEuler.net, and it is a problem to find the largest palindrome constructed from the product of two three-digit integers.

Now, the answer (spoilers, if you don't want to know ) is 906609. However, I got a different answer, but possibly my logic is incorrect. Can anyone spot a flaw in the following reasoning:

As the upper bound of 2 3-digit numbers, I chose 999^2 = 998001. Hence, by counting down from this to a lower limit (say 100) I should have all of the 3-digit integer products in this range? Thus, by starting at the upper limit and counting down, and then testing each integer at every step for the palindrome property, I should find the largest.

I found a palindrome, 997799 which is > the given answer and < 999^2. However, I can't see the flaw in my logic which would imply that this is incorrect and the given answer is correct. Can anyone point me in the right direction? Thanks!

Edit: ok, I think I may have seen the flaw...I guess starting at N^2 and working down is not correct as, I can't guarantee that the factorization at each step is two three-digit integers.
 
Last edited:
Physics news on Phys.org
You found it. 997799 = 11 x 90709 is not the product of two three-digit integers.
 

Similar threads

Back
Top