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

Home > Numbers
Divisor and Quotient Determination (Posted on 2024-02-07) Difficulty: 3 of 5
Determine the quotient, divisor and the dividend from this incomplete division:
                 
                          
         
                  H * B
            +-----------
         A B| * G C D *
              * * I
             ---------
                F F *
                  G *
             -----------
                  A H F
                  A H F
                --------
                 

See The Solution Submitted by K Sengupta    
Rating: 4.5000 (2 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution Computer solution | Comment 1 of 2
                 639
            +------
        29|18531
              174
              -----
                113
                  87
                 -----
                  261
                  261
                 -----

I rewrote the original problem with lowercase letters in place of asterisks and set up several variable names:
                    H q B    quot
            +-----------
       A B| r G C D s     one
              t w I            two
             ---------
                 F F x        three
                   G y         four
             -----------
                   A H F      five
                   A H F       six
                --------

program output
2 9 5 3 1 8 6 4
29 639 18531 174 113 87

--------------------------
for A in range(10):
    for B in range(10):
        if A==B:
            continue
        AB = 10*A + B
        for H in range(10):
            if H in [A,B]:
                continue
            for q in range(10):
                quot = 100*H + 10*q + B
                one = AB*quot
                if len(str(one)) != 5:
                    continue
                G = int(str(one)[1])
                C = int(str(one)[2])
                D = int(str(one)[3])
                if G in [A,B,H]:
                    continue
                if C in [A,B,H,G]:
                    continue
                if D in [A,B,H,G,C]:
                    continue
                two = H * AB
                if len(str(two)) != 3:
                    continue
                I = two%10
                if I in [A,B,H,G,C,D]:
                    continue
                three = (one//100 - two)*10 + D
                if len(str(three)) != 3:
                    continue
                F = int(str(three)[0])
                if int(str(three)[1]) != F:
                    continue
                if F in [A,B,H,G,C,D,I]:
                    continue
                four = q * AB
                AH = three - four
                if AH != 10*A + H:
                    continue
                print(A,B,C,D,F,G,H,I)
                print(AB,quot,one,two,three,four)

  Posted by Larry on 2024-02-08 00:04:03
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 (10)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

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