|Spoiler Inside: Solution to Puzzle||SelectShow>|
I could say that I solved this with my mathematical sophistication, but I decided to go cheap. I wrote a program to do it. I enumerated all of the cases that followed from the rules above. My program looped through all possibilities and counted only those combinations that survived the checking.
Mathematical elegance is a wonderful thing. So is getting the answer quickly.
If you did try doing it the long way, note that many combinations would be eliminated under more than one rule. 0111 can be eliminated because of rule 1 (three digits the same), rule 3 (has its digits in ascending order), and rule 4 (01 × 1 = 1). Your solution would have to avoid counting these more than once.