Solve this alphametic multiplication problem, where each of the small letters denotes a different base 14 digit from 0 to D, and each of the asterisks denotes a base 14 digit from 0 to D whether same or different. None of the numbers can contain any leading zero.
|
|
e |
i |
g |
h |
t |
|
|
|
|
t |
w |
o |
--------------------- |
|
|
* |
* |
* |
* |
* |
|
* |
* |
* |
* |
* |
|
* |
* |
* |
* |
* |
|
|
--------------------- |
s |
i |
x |
t |
e |
e |
n |
000100 DIM used(13)
000200
000300 FOR t = 1 TO 13
000400 IF used(t) = 0 THEN
000500 : used(t) = 1
000600 : FOR o = 1 TO 13
000700 : IF used(o) = 0 THEN
000800 : used(o) = 1
000900 : n = (t * o) @ 14
001000 : IF used(n) = 0 THEN
001100 : used(n) = 1
001200 :
001300 : FOR h = 0 TO 13
001400 : IF used(h) = 0 THEN
001500 : used(h) = 1
001600 : FOR w = 0 TO 13
001700 : IF used(w) = 0 THEN
001800 : used(w) = 1
001900 : en = ((h * 14 + t) * (w * 14 + o)) @ (14 * 14)
002000 : e = en \ 14
002100 : IF used(e) = 0 AND e <> 0 THEN
002200 : used(e) = 1
002300 : :
002400 : FOR g = 0 TO 13
002500 : IF used(g) = 0 THEN
002600 : used(g) = 1
002700 : een = ((g * 14 * 14 + h * 14 + t) * (t * 14 * 14 + w * 14 + o)) @ (14 * 14 * 14)
002800 : IF een \ (14 * 14) = e THEN
002900 :
003000 : FOR i = 0 TO 13
003100 : IF used(i) = 0 THEN
003200 : used(i) = 1
003300 : teen = ((i * 14 * 14 * 14 + g * 14 * 14 + h * 14 + t) * (t * 14 * 14 + w * 14 + o)) @ (14 * 14 * 14*14)
003400 : IF teen \ (14 * 14 * 14) = t THEN
003500 :
003505 : sixteen = ((e*14*14*14*14 + i * 14 * 14 * 14 + g * 14 * 14 + h * 14 + t) * (t * 14 * 14 + w * 14 + o))
003510 : s=sixteen \ (14^6):i2=(sixteen\(14^5))@14:x=(sixteen\(14^4))@14
003515 : if s<14 then
003520 : if s>0 and used(s)=0 and i2=i and x<14 and used(x)=0 and x<>s then
003530 :
003535 : eight=e*14^4+i*14^3+g*14^2+h*14+t:eightT=eight*t:eightW=eight*w:eightO=eight*o
003540 :
003541 :
003600 : PRINT e;i; g; h; t: PRINT t; w; o
003610 : print 1+int(log(eightO)/log(14));
003611 : print 1+int(log(eightW)/log(14));
003612 : print 1+int(log(eightT)/log(14));:print
003613 : PRINT s;i;x;t; e; e; n: print
003620 :
003710 : end if
003715 : end if
003800 : END IF
003900 : used(i) = 0
004000 : END IF
004100 : NEXT
004200 :
004300 :
004400 : END IF
004500 : used(g) = 0
004600 : END IF
004700 : NEXT
004800 :
004900 :
005000 : used(e) = 0
005100 : END IF
005200 : used(w) = 0
005300 : END IF
005400 : NEXT
005500 : used(h) = 0
005600 : END IF
005700 : NEXT
005800 :
005900 :
006000 : used(n) = 0
006100 : END IF
006200 : used(o) = 0
006300 : END IF
006400 : NEXT
006500 : used(t) = 0
006600 : END IF
006700 : NEXT
finds
1 5 2 9 7
7 8 6
5 5 5
10 5 12 7 1 1 0
where the 1st, 2nd and 4th lines represent the digits of eight, two and sixteen respectively, and the 5 5 5 confirms that the partial products all contain 5 base-14 digits. Decimal equivalents of the digits A - D are used rather than the letters.
The 15297 * 786 = A5C7110 solution is the only one found, even disregarding the lengths of the partial products.
|
Posted by Charlie
on 2010-05-28 12:55:30 |