DEFDBL A-Z
FOR n = 100 TO 999
FOR a = 1 TO 7
na = n * a
FOR b = a + 1 TO 8
nb = n * b
FOR c = b + 1 TO 9
nc = n * c
chk$ = LTRIM$(STR$(na)) + LTRIM$(STR$(nb)) + LTRIM$(STR$(nc))
REDIM digchk(9)
FOR i = 1 TO LEN(chk$)
digchk(VAL(MID$(chk$, i, 1))) = 1
NEXT
good = 1
FOR i = 1 TO 9
IF digchk(i) = 0 THEN good = 0
NEXT
IF good AND LEN(chk$) = 9 THEN
PRINT n, a; b; c, na; nb; nc
END IF
NEXT
NEXT
NEXT
NEXT
finds
107 3 7 8 321 749 856
109 3 6 9 327 654 981
123 4 5 6 492 615 738
129 1 3 5 129 387 645
192 1 2 3 192 384 576
219 1 2 3 219 438 657
273 1 2 3 273 546 819
327 1 2 3 327 654 981
123 multiplied by 4, 5 and 6 (the third line) has a certain ring to it; it's the only one in which none of the single digits appear in the original 3-digit number.
Edited on January 23, 2013, 12:43 pm
|
Posted by Charlie
on 2013-01-23 12:42:01 |