xpi0t0s's Avatar, Join Date: Aug 2004
Mentor
Yes Saswat I brute forced it. I'm obviously not up to your standards.
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
Quote:
Originally Posted by nimesh View Post
"The last condition looks incomplete."
I mean the sentence formation is incorrect. Which you have corrected now...haha
Yes. It was not conditional error but a typo.

Quote:
Originally Posted by nimesh View Post
What reason would you like? [btw, you didn't asked earlier to specify the reason]
Just curious. Nothing to with the competition

Quote:
Originally Posted by SaswatPadhi View Post
@ shabbir:
So, you changed the posting time today (by almost -12 hours) !!
I'll have to wait till 2morrow.
So its not predictable.

Quote:
Originally Posted by xpi0t0s View Post
Whoops, you're right, neither are 537 and 737 so the only result is 373. Adding
Code:
if (is_prime(i))
fixed the problem.
Logic is also there. 2,3,5,7 are the digits which needs to be filled in the 3 slots.
  • 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
Winner is Nimesh and I did not mention smallest largest anything because I knew it has unique solution
nimesh's Avatar, Join Date: Apr 2009
Invasive contributor
Cool...
Nice explanation Shabbir. I like it.
SaswatPadhi's Avatar, Join Date: May 2009
~ Б0ЯИ Τ0 С0δЭ ~
Quote:
Originally Posted by shabbir View Post
So its not predictable.
So, you have implemented a manual version of my random posting time idea
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
Quote:
Originally Posted by SaswatPadhi View Post
So, you have implemented a manual version of my random posting time idea
To an extent.