All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Numbers
Why fight? (Posted on 2020-07-08) Difficulty: 3 of 5
If
win*war=enigma
What is the value of gain ?

See The Solution Submitted by Ady TZIDON    
Rating: 3.0000 (1 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution Another computer soln; Python | Comment 2 of 3 |
Output of program:
549 * 537 = 294813  and gain = 8349
done 1

Some of the letters changed just for my convenience:
winaregm  ->  BCDAFEGH
BCD * BAF = EDCGHA
gain  ->  GACD
 ----- program follows -----

count = 0                                   
for A in range(0,10):
    for B in range(1,10):
        if A==B:
            continue
        for C in range(0,10):
            if A==C or B==C:
                continue
            for D in range(0,10):
                if A==D or B==D or C==D:
                    continue
                for E in range(1,10):
                    if A==E or B==E or C==E or D==E:
                        continue
                    for F in range(0,10):
                        if A==F or B==F or C==F or D==F or E==F:
                            continue
                        for G in range(0,10):
                            if A==G or B==G or C==G or D==G or E==G or F==G:
                                continue
                            for H in range(0,10):
                                if A==H or B==H or C==H or D==H or E==H or F==H or G==H:
                                    continue
                                win = 10**2*B + 10**1*C + 10**0*D
                                war = 10**2*B + 10**1*A + 10**0*F
                                enigma = 10**5*E + 10**4*D + 10**3*C + 10**2*G + 10**1*H + 10**0*A
                                if win * war == enigma:
                                    count += 1
                                    gain = 10**3*G + 10**2*A + 10**1*C + 10**0*D
                                    print (win,'*',war,'=',enigma,' and gain =',gain)


print('done', count)

  Posted by Larry on 2020-07-09 11:39:05
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (2)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2020 by Animus Pactum Consulting. All rights reserved. Privacy Information