Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Simple Math Puzzle...

by hossman (Prior)
on May 10, 2003 at 07:59 UTC ( [id://257088]=note: print w/replies, xml ) Need Help??


in reply to Simple Math Puzzle...

BTW, I just noticed...
  • Digit 3 is the highest number.
  • Digit 5 is ... half of digit 4.
  • Digit 1 is higher than the sum of digits 4 and 5.

Which means assuming 3 is "9" (as big as it can be), then 1 can be at most "8", so 4 + 5 can be at most "7", so the biggest they can be are "4" and "2".

So now you've got "8_942" as your max, and with the no duplicates rule (and the "2 is lowest" rule), that means you can stop your for loop at "83945".

UPDATE: But wait, there's more!!!!!

Using the same rules, we can increase the starting number of your for loop ... 4 and 5 have to be at least "2" and "1" (because of the half rule) which means 1 has to be at least "4", which gives you 4__21, so you can safely start your for loop at "40321".

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://257088]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (6)
As of 2024-03-28 15:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found