3-digit positive decimal integers P
, each having no leading zeroes and with P
, are such that:
(i) The product P
one 8, one 6, one 5, one 4, two 3ís and three 2ís (albeit not necessarily in this order), and:
consists of precisely
9 digits with the last digit
being 6, and:
are obtained from one another by cyclic permutation
Determine all possible triplet(s) (P
) that satisfy the given conditions.
: This problem can be solved without using a computer program, however computer program/spreadsheet solutions are welcome.
FOR n1 = 100 TO 999
ns$ = LTRIM$(STR$(n1))
n2 = VAL(MID$(ns$, 2) + LEFT$(ns$, 1))
n3 = VAL(MID$(ns$, 3) + LEFT$(ns$, 2))
prod$ = LTRIM$(STR$(n1 * n2 * n3))
IF LEN(prod$) = 9 THEN
t$ = "865433222"
FOR i = 1 TO 9
ix = INSTR(t$, MID$(prod$, i, 1))
IF ix = 0 THEN EXIT FOR
t$ = LEFT$(t$, ix - 1) + MID$(t$, ix + 1)
IF t$ = "" THEN PRINT n1; n2; n3, prod$
398 983 839 328245326
839 398 983 328245326
983 839 398 328245326
Since P > Q > R, the triplet is (983, 839, 398) and the product is 328,245,326.
Posted by Charlie
on 2009-02-07 17:00:51