I don't quite get you.
Hi,
I have found a long division problem and I am getting stuck with the solution, to be honest i dont even know where to start!!
(The . above the X is not for recurring numbers, it is just there so the top line of the division sits correctly)
The question is: solve the following long division, each letter represents a unique digit (0-9)
Thanks for your helpCode:. B XZD)BUMG APZK ABU
Trial and error, after establishing some reasonable ranges...
Only 2 equations given:
B(100X + 10Z + D) = 1000A + 100P + 10Z + K
1000B + 100U + 10M + G - (1000A + 100P + 10Z + K) = 100A + 10B + U
With 10 variables, you'd need 10 equations to "solve"; so some guesswork required.
These are known as "alphametic puzzles". Use google to see examples.
Changed your lettering to a to j:
My program (simplified):Code:a ==== bcd)aefg hicj ==== hae
Loop 10 variables a to j from 0 to 9 keeping the variables distinct
Keep a > 1, h = a-1, b > 0
u = 100*b + 10*c + d
v = 1000*a + 100*e + 10*f + g
w = 1000*h + 100*i + 10*c + j
x = 100*h + 10*a + e
If w = a * u and x = v - w then print a,u,v,w,x
Result: 7, 934, 7210, 6538, 672
I don't think anybody can show how to do this completely by hand,
as it's a bit like teaching how to dig a hole
But you never know: perhaps someone can...but won't be me!
I use UBasic, and do the programming myself; here tizz:
FOR a = 2 TO 9
FOR b = 1 TO 9 : IF b = a THEN NEXT b
FOR c = 0 TO 9 : IF c = a OR c = b THEN NEXT c
FOR d = 0 TO 9 : IF d = a OR d = b OR d = c THEN NEXT d
u = b*100 + c*10 + d
FOR e = 0 TO 9 : IF e=a OR e=b OR e=c OR e=d THEN NEXT e
FOR f = 0 TO 9 : IF f=a OR f=b OR f=c OR f=d OR f=e THEN NEXT f
FOR g = 0 TO 9 : IF g=a OR g=b OR g=c OR g=d OR g=e OR g=f THEN NEXT g
h = a-1 : IF h=b OR h=c OR h=d OR h=e OR h=f OR h=g THEN NEXT g
v = a*1000 + e*100 + f*10 + g
x = h*100 + a*10 + e
FOR i=0 to 9: IF i=a OR i=b OR i=c OR i=d OR i=e OR i=f OR i=g OR i=h THEN NEXT i
FOR j=1 to 9: IF j=a OR j=b OR j=c OR j=d OR j=e OR j=f OR j=g OR j=h OR j=i THEN NEXT j
w = h*1000 + i*100 + c*10 + j
IF w = a*u AND x = v - w THEN PRINT a,u,v,w,x
ENDLOOPS
Hope that helps.