First, I went back through my Euler folder, and this isn't problem #3,

it's #4.

Project Euler #4 wrote: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.

A brute force method works okay in this instance, there are 899 3 digit numbers (100-999) which would be just over 800,000 iterations if you for-next from 100-999. That should only take a couple of seconds.

And as Philip pointed out, you are only testing the first multiplicand, not the product.

Your test for a six digit number is okay, but if you're using VB, why not use the StrReverse function?

n = i*j

If CStr(n) = StrReverse(CStr(n)) Then '// proof of palindrome

Then, you need to test if n is larger than any previous palindromic n's found.

Use another variable, say x, and initially assign it a very small value like 101.

Test if n is greater than x, and if so, reassign x as n.

When the loops finish, x will be your answer.

Note: The solution in VB with brute force and no optimization takes about 2-3 seconds for 810,000 iterations. Optimized, it runs in less than 1/10th of a second and goes through less than 10,000 iterations. That should give you something to shoot for if you are using Euler to brush up your optimization skills.

EDIT - (ninja'd on the problem number)

Agent_Irons wrote:I'm going to go with the early termination problem. Just find all palindromes, and if you find one larger than the current largest palindrome replace it. And so on. When you've tested all the combinations all the way down to 100x100 (definitely not the answer) the remaining largest palindrome must be the answer.

The problem there is that not all palindromes are the product of two 3-digit numbers. 999,999 is palindromic, but is 999 * 1001, 998,899 is also palindromic, but is 781 * 1279