in reply to Simple Math Puzzle...
- 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".
|
|---|