Page 2 of 5
Re: Problem 004
Posted: Fri Jan 08, 2010 11:14 am
by harryh
Hi theslimzmassive,
Please do not post in this forum the answers or any spoilers for any problem; this forum is open to everyone (whether they have solved a particular problem or not), so spoilers are not allowed. As a result, I snipped the correct answer from your post.
As far as I can tell, the answer you propose (997799) is NOT the product of two three-digit numbers, so it cannot possibly be correct.
Finally, before starting a new thread (topic) in this forum, please make sure that -for the given problem- there is no previous topic on it. If a topic already exists, add your question to it.
Problem 004
Posted: Sat Jul 03, 2010 1:22 pm
by Roxxor
Hello! I am new to Project Euler.
Problem 4 reads:
A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 × 99.
Find the largest palindrome made from the product of two 3-digit numbers.
The biggest palindrome I can find with 3 digit numbers is:
But the correct answer is lower than my answer and is considered to be the correct one.
How come?
Re: Problem 004
Posted: Sat Jul 03, 2010 1:35 pm
by harryh
A. Your answer is NOT palindromic. 990009, if read the other way round becomes 9000099.
B. Please do not start a new topic, if one exists for the same problem! (More often than not, you'll also find what you are looking for being there already...)
Re: Problem 004
Posted: Sat Nov 06, 2010 6:10 pm
by Rakshasa
I've looked through both first few of the first and last pages of the solution thread, and none of them give any proper optimal solution. Would it be possible to temporarily unlock the thread for me to post a clean, readable and pretty damn fast example?
Re: Problem 004
Posted: Sat Nov 06, 2010 7:01 pm
by harryh
Have you also looked at the pdf for the problem?
If you have, and if you are absolutely certain that your method is faster than that, you can PM me your method.
We will then consider re-opening the thread.
Re: Problem 004
Posted: Sat Nov 06, 2010 7:45 pm
by Rakshasa
harryh wrote:Have you also looked at the pdf for the problem?
If you have, and if you are absolutely certain that your method is faster than that, you can PM me your method.
We will then consider re-opening the thread.
Looked at it and yes, my solution would appear to be more optimal. PM sent.
Re: Problem 004
Posted: Thu Dec 16, 2010 7:03 am
by AcousticBruce
Since I cant post code. I am unsure how to ask what I did wrong.
My code seems correct to me, but it is obvious that Project Euler feels different. Im sure I have the error
I see that some people have the code hidden. How do I do this? Or better yet should I do that?
I am a Java programmer. Can you help me? How do I show someone the code to see what I did wrong?
Re: Problem 004
Posted: Thu Dec 16, 2010 7:20 am
by Lord_Farin
You can send me a PM with your code, then I will look into it.
Re: Problem 004
Posted: Thu Feb 03, 2011 10:47 pm
by nogo
Maybe anyone is willing to look through my code too?
It's written in Java and works well for 2-digit-numbers, for 3-digit-numbers I even have 2 solutions - depending on whether a "word" with an uneven number of characters is accepted as an palindrom or not.
However, nether of those solutions is accepted, and I cannot see where the problem is...
Re: Problem 004
Posted: Fri Feb 04, 2011 12:19 am
by TripleM
Sure.
Re: Problem 004
Posted: Sat Apr 02, 2011 5:20 am
by zlaw777
I can't figure out why I'm getting a Array Out of Bounds Exception. (Am I supposed to make my own thread? I couldn't find where to do so)
Code:
for(int i=palindromes.size()-1;i>=0;i--)
{
for(int b=divisors.size()-1;i>=0;b--)
{
temp=(Integer) palindromes.get(i);
temp2=(Integer)divisors.get(b); // This is where eclipse says the problem is
divide=(temp%temp2);
}
}
Re: Problem 004
Posted: Sat Apr 02, 2011 5:31 am
by jaap
zlaw777 wrote:for(int b=divisors.size()-1;i>=0;b--)
Re: Problem 004
Posted: Sat Apr 02, 2011 5:38 am
by zlaw777
Hahaha. Thank you so much. I was trying to figure out what was wrong for a good half hour.
Re: Problem 004
Posted: Sat May 07, 2011 5:17 pm
by Francky
I'm proud of my solution,
with n=9 (instead n=3), I can find in few seconds of Python
999 900 665 566 009 999 product of two 9-digits numbers, the greatest.
Interested ?
Re: Problem 004
Posted: Wed May 11, 2011 11:42 pm
by Areadrill
K so I worked out a program and got the right answer... but when I try to submit it it tells me it's wrong!
I personally checked ALL the products from 3-digit numbers from 100*100 to 999*999. I am getting seriously annoyed by it.
I know I'm right and it tells me I'm wrong. Please help me! :S
Re: Problem 004
Posted: Thu May 12, 2011 12:58 am
by TripleM
Which do you believe is more likely - 82195 people who have correctly solved the problem all have the same wrong answer, or you do?
Feel free to PM me if you want a hint as to what you've done wrong, but the first step to fixing your problem is believing you actually have one. Once you've truly done that it often becomes a lot easier to see the mistake.
Re: Problem 004
Posted: Thu May 12, 2011 1:57 am
by GenePeer
Areadrill wrote:I personally checked ALL the products from 3-digit numbers from 100*100 to 999*999.
You personally checked over 404,550 different products??? By checking do you mean:
100*100, 101*101, 102*102, ..., 998*998, 999*999
or
100*100, 100*101, 100*102, ..., 998*999, 999*999?
Re: Problem 004
Posted: Thu May 12, 2011 11:31 am
by Areadrill
I checked them all from the last (999*999) till I found the first palindrome! Then I checked form that up to see if I had it wrong and so on... Took me a while too.

Re: Problem 004
Posted: Thu May 12, 2011 11:54 am
by jaap
Areadrill wrote:I checked them all from the last (999*999) till I found the first palindrome! Then I checked form that up to see if I had it wrong and so on... Took me a while too.

But what if you make one of the factors a bit smaller and the other much larger, wouldn't that give a larger number that might be a palindrome too?
Re: Problem 004
Posted: Thu May 12, 2011 11:57 am
by Areadrill
Weeeeeeeell... i didn't think of that. Lol i'm such an idiot... thanks for helping!
