This checks all pairs of A and G to see if a valid BCDEF is found.
DEFDBL A-Z
FOR a = 2 TO 9
FOR g = 1 TO 9
REDIM used(9)
used(a) = 1: used(g) = 1
bcdef = g * 111111 / a
good = 0
IF bcdef = INT(bcdef) THEN
b$ = LTRIM$(STR$(bcdef))
good = 1
FOR i = 1 TO LEN(b$)
d = VAL(MID$(b$, i, 1))
IF used(d) THEN good = 0: EXIT FOR
used(d) = 1
NEXT
IF good THEN PRINT a; bcdef; g * 111111
END IF
NEXT
NEXT
If finds only
7 95238 666666
|
Posted by Charlie
on 2005-11-18 11:05:35 |