Categories
Puzzles

A puzzle

A mathematical (sort of) puzzle to help you while away your lunchbreak. I haven’t worked out the answer yet myself, so if you beat me to it, you can have at least one kudo, maybe more.

ELEVEN +
 THREE
 THREE
   ONE
   ONE
   ONE
______
TWENTY

Each letter has a numerical value from 0-9 (no two letters can have the same value)
We are told that:
E is either 1,3,5,7
O is not 0
T is not 0

Go for it! (And no sneaky writing a program to solve it exhaustively [unless that turns out to be the only way…].)

14 replies on “A puzzle”

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!

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.

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!

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.

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…)

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)

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.)

Leave a Reply to dr_bob Cancel reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.