MATH AND LOGIC

LOL What?

Cryptograms are puzzles where capital letters stand in for the digits of a number. If the same letter is used twice, it’s the same digit in both places, and if different letters are used, the digits are also different.

Keep reading to see a couple example puzzles, or dive right into today’s challenge.

Today’s Challenge

If the same letter is used twice, it’s the same digit in both places, and if different letters are used, the digits are also different.

No number is written with a leading zero. For example, 53 cannot be written as 053.

Given the above addition, which are possible values of O?

Key

Obviously, from hundred’s digit we can find that L=B+A+D<10. In other words, there is no possibility to exist a carry.
Meanwhile, from ten’s digit we know O=2A+L=3A+B+D<10
OK, now, as A B and C represent diffident numbers, A+B+D≥6, A≥1.
So O≥8 and we know O=8 or O=9

Program

Here also have a code to answer the question.

for a in range(1,10):
    for b in range(1,10):
        for d in range(1,10):
            for l in range(1,10):
                for o in range(1,10):
                    x = [a,b,d,l,o]
                    if len(x) == len(list(set(x))): # to check if all letters are distinct.
                        if 121*a + 10*l + 101*(d+b) == 101*l + 10*o:
                            print (str(100*d+10*a+b)+' + '+str(101*a+10*l)+' + '+str(100*b+10*a+d)+' = '+str(101*l+10*o))

and its results.

312 + 161 + 213 = 686
412 + 171 + 214 = 797
213 + 161 + 312 = 686
214 + 171 + 412 = 797

As you can see, o (which is the middle digit of theresult of addition) can only be 8 or 9.

End

I am willing to recommend a website to you——BRILLIANT(you can visit it by click the word)

Author VaQX