A telephone number has the form ABC-DEF-GHIJ, where each letter represents a different digit.

The digits in each part of the number are in decreasing order; that is, A > B > C,
D > E > F, and G > H > I > J.

Furthermore, D, E, and F are consecutive even digits; G, H, I, and J are consecutive odd digits;
and A + B + C = 9.

What is the telephone number?
Justify your answer.

Solution to the Problem:

The telephone number is 810 - 642 - 9753.

The last four digits GHIJ are either 9753 or 7531, and the other odd digit (1 or 9) must be A, B, or C.

Since A + B + C = 9, that digit must be 1.

Thus the sum of the two even digits in ABC is 8.  

DEF must be 864, 642, or 420, which respectively leave the pairs 2 and 0, 8 and 0, or 8 and 6, as the two even digits in DEF.

Only 8 and 0 has sum 8, so ABC is 810.



James Alarie sent in the following two solutions:

Does a listing of my program count as justification of the answer?  Here it is:
for ($A=2; $A<=9; $A++) {
  for ($B=1; $B<$A; $B++) {
    for ($C=0; $C<$B; $C++) {
     if ($A + $B + $C == 9) {
      for ($D=4; $D<=9; $D=$D+2) {
       if (($D != $A) && ($D != $B) && ($D != $C)) {
        $E=$D-2;
        if (($E != $A) && ($E != $B) && ($E != $C)) {
         $F=$E-2;
         if (($F != $A) && ($F != $B) && ($F != $C)) {
          for ($G=7; $G<=9; $G=$G+2) {
           if (($G != $A) && ($G != $B) && ($G != $C)
           &&  ($G != $D) && ($G != $E) && ($G != $F)) {
            $H=$G-2;
            if (($H != $A) && ($H != $B) && ($H != $C)
            &&  ($H != $D) && ($H != $E) && ($H != $F)) {
             $I=$H-2;
             if (($I != $A) && ($I != $B) && ($I != $C)
             &&  ($I != $D) && ($I != $E) && ($I != $F)) {
              $J=$I-2;
              if (($J != $A) && ($J != $B) && ($J != $C)
              &&  ($J != $D) && ($J != $E) && ($J != $F)) {
               print "$A$B$C-$D$E$F-$G$H$I$J\n";
              }
             }
            }
           }
          }
         }
        }
       }
      }
     }
    }
  }
}



Now, I'm looking at this in a more logical manner.  The DEF part can
only be 420, 642, or 864, and the GHIJ part can only be 7531 or 9753.
A quick pairing listing the missing digits gives:

 420-7531  6,8,9  does not add to 9
 642-7531  0,8,9  does not add to 9
 864-7531  0,2,9  does not add to 9
 420-9753  1,6,8  does not add to 9
 642-9753  0,1,8  this one works
 864-9753  0,1,2  does not add to 9

The answer is 810- 642-9753.


Correctly solved by:

1. Marivi Bungay-Domingo Philippines
2. James Alarie Flint, Michigan
3. Martin Round Studley, Warwickshire, West Midlands, United Kingdom
4. Alyx Wells Mountain View High School,
Mountain View, Wyoming
5. Kursat Guzey Birdville Independent School District,
Haltom City, Texas
6. Anna Tetzlaf and Eliza Sheffield Tuscaloosa, Alabama
7. David Day Harlingen, Texas
8. Randy Lerner Mundelein High School,
Mundelein, Illinois
9. Jim Hooker Johnson City, Tennessee
10. Brijesh Dave Mumbai city, Maharashtra, India
11. Adalene Thomas Mountain View High School,
Mountain View, Wyoming