14 Responses

  1. karohemd
    karohemd May 17, 2005 at 12:03 pm |

    Don’t ask me, I’m a linguist. ;oP

    Reply
  2. wimble
    wimble May 17, 2005 at 12:35 pm |

    I’ve brute forced it.

    There is only one answer, and it takes my box 100 seconds to find it.

    Here’s the perl script, for those who are too lazy 😉

    #! /usr/bin/perl -w
    use strict;
    
    sub total(@) {
      my $t=0;
      foreach my $d (@_) {
        $t*=10;
        $t+=$d;
      }
      return $t;
    }
    
    my %vals=map {$_=>undef} (0..9);
    foreach my $e (sort keys %vals) {
      next unless ($e==1 || $e==3 || $e==5 || $e==7);
      delete $vals{$e};
      foreach my $l (sort keys %vals) {
        delete $vals{$l};
        foreach my $v (sort keys %vals) {
          delete $vals{$v};
          foreach my $n (sort keys %vals) {
            delete $vals{$n};
            foreach my $t (sort keys %vals) {
              next if $t==0;
              delete $vals{$t};
              foreach my $h (sort keys %vals) {
                delete $vals{$h};
                foreach my $r (sort keys %vals) {
                  delete $vals{$r};
                  foreach my $o (sort keys %vals) {
                    next if $o==0;
                    delete $vals{$o};
                    foreach my $w (sort keys %vals) {
                      delete $vals{$w};
                      foreach my $y (sort keys %vals) {
                        delete $vals{$y};
                        my $eleven=total($e, $l, $e, $v, $e, $n);
                        my $three=total($t, $h, $r, $e, $e);
                        my $one=total($o, $n, $e);
                        my $twenty=total($t, $w, $e, $n, $t, $y);
                        if ($eleven+$three+$three+$one+$one+$one==$twenty) {
                          print<<EOF
    $eleven+
     $three+
     $three+
       $one+
       $one+
       $one
    -------
    $twenty
    EOF
                        }
                        $vals{$y}=undef;
                      }
                      $vals{$w}=undef;
                    }
                    $vals{$o}=undef;
                  }
                  $vals{$r}=undef;
                }
                $vals{$h}=undef;
              }
              $vals{$t}=undef;
            }
            $vals{$n}=undef;
          }
          $vals{$v}=undef;
        }
        $vals{$l}=undef;
      }
      $vals{$e}=undef;
    }
    

    With apologies to Mo for the failed posting attempts!

    Reply
    1. undying-admin
      undying-admin May 17, 2005 at 1:37 pm |

      Good stuff! You win the kudo.

      Reply
      1. wimble
        wimble May 17, 2005 at 1:43 pm |

        Eh? But you said brute forcing wasn’t allowed. I shouldn’t be getting a kudo for that!

        I’ve really got as far as observing that N and Y differ by 5 (since N+5E=Y), and that the carry from the Hundreds column must be even (since E+2H+carry=E).

        I don’t even know if I’m any good at these problems, since I always give up on them really quickly.

        Reply
        1. undying-admin
          undying-admin May 17, 2005 at 1:57 pm |

          But you said brute forcing wasn’t allowed. I shouldn’t be getting a kudo for that!

          No, you shouldn’t — but as no-one else had come up with anything at all, it goes to you by default!

          Reply
          1. wimble
            wimble May 17, 2005 at 2:02 pm |

            Well, yeah. Most people seem to think it’s my default.


  3. dr_bob
    dr_bob May 17, 2005 at 1:54 pm |

    I’ve got two possible combinations for E, N, T and Y. And 3O+V+2R+(4 or 1)=28 or 8. Now I have to go back to work :o(

    Reply
    1. undying-admin
      undying-admin May 17, 2005 at 1:58 pm |

      I’ll give you half a kudo for that, for making the effort…

      Reply
    2. wimble
      wimble May 17, 2005 at 3:17 pm |

      Erm, wrong somewhere: 3O + V + 2R does not end in 4 nor 7. So adding 4 or 1 doens’t give you 28 or 8. Erm, and the carry from the tens column into the hundreds is neither 4 nor 1.

      Reply
  4. bateleur
    bateleur May 17, 2005 at 2:19 pm |

    Couldn’t spot anything very clever.

    Eventually solved it by case analysis, but that’s really just brute force with a bit of pruning. Starting from the left and attacking the small cases first seemed to work well, but I’m not sure if that’s just coincidence.

    (My answer matches the one given by Tommy’s Perl script, which is probably a good sign…)

    Reply
    1. timlagor
      timlagor May 17, 2005 at 3:47 pm |

      I don’t get it

      5E + N = Y
      => E is odd or N = Y

      & E != 1, 3, 5, 7
      => E = 9

      E + x = T => E =< T

      So either N=Y, E=T or E is 1, 3, 5, or 7

      Someone please point out where I’ve gone wrong.

      (perl means nothing to me)

      Reply
      1. undying-admin
        undying-admin May 17, 2005 at 3:54 pm |

        Re: I don’t get it

        Your “E != 1, 3, 5, 7” is incorrect — the condition stated is “E is either 1,3,5,7″.

        Reply
        1. timlagor
          timlagor May 17, 2005 at 3:55 pm |

          Re: I don’t get it

          that would do it.

          Reply
    2. undying-admin
      undying-admin May 17, 2005 at 3:56 pm |

      In that case you can have a kudo too, and is reduced to a half.

      (I think starting from the left was a good idea — I tried starting from the right, and I had to run through a lot of cases before it started to look right.)

      Reply

Leave a Reply