X is a positive eight-digit base ten integer of the form
CONSIDER where each of the capital letters in bold denotes a different base ten digit from 0 to 9, and satisfies all of the following conditions, where
C is nonzero.
- CO is divisible by 2.
- CON is divisible by 3.
- CONS is divisible by 4.
- CONSI is divisible by 5.
- CONSID is divisible by 6.
- CONSIDE is divisible by 7.
- CONSIDER is divisible by 8.
Determine the respective minimum and maximum value of X.
The possible values of x:
12965408
30925864
36925840
38165472
72965480
78320416
78920456
80165472
92765408
DECLARE SUB addOn ()
DEFDBL A-Z
DIM SHARED used(9), st$, ct
FOR i = 1 TO 9
used(i) = 1
st$ = LTRIM$(STR$(i))
addOn
used(i) = 0
NEXT
PRINT ct
END
SUB addOn
FOR i = 0 TO 9
IF used(i) = 0 THEN
used(i) = 1
st$ = st$ + LTRIM$(STR$(i))
v = VAL(st$)
IF v MOD LEN(st$) = 0 THEN
IF LEN(st$) = 8 THEN
PRINT st$: ct = ct + 1
ELSE
addOn
END IF
END IF
st$ = LEFT$(st$, LEN(st$) - 1)
used(i) = 0
END IF
NEXT
END SUB
|
Posted by Charlie
on 2009-11-05 16:58:13 |