Yes Saswat I brute forced it. I'm obviously not up to your standards.

Quote:

Originally Posted bynimesh"The last condition looks incomplete."

I mean the sentence formation is incorrect. Which you have corrected now...haha

Quote:

Originally Posted bynimeshWhat reason would you like? [btw, you didn't asked earlier to specify the reason]

Quote:

Originally Posted bySaswatPadhi@ shabbir:

So, you changed the posting time today (by almost -12 hours) !!

I'll have to wait till 2morrow.

Quote:

Originally Posted byxpi0t0sWhoops, you're right, neither are 537 and 737 so the only result is 373. Adding

fixed the problem.Code:if (is_prime(i))

- 2 and 5 cannot come in the last slot other wise number would not be prime, so it has to be 3 and 7.
- With the above logic 2 and 5 also cannot come in the second slot as the number with those should also be prime.
- Any combination of 5,3,7 or 2,3,7 is divisible by 3
- 7 and 3 cannot be at consecutive places as we need primes by both the numbers.
- so the option left is 373 and 737
- 737 is not prime

Cool...

Nice explanation Shabbir. I like it.

Nice explanation Shabbir. I like it.