What is the smallest number so that if you move its last digit to the beginning (for example, turning 1234 into 4123) you get a new number that is an integer multiple of the original number?
Number new numb. multiple
102564 410256 4
128205 512820 4
142857 714285 5
153846 615384 4
179487 717948 4
205128 820512 4
230769 923076 4
DEFDBL A-Z
n = 11
DO
n1$ = LTRIM$(STR$(n))
n2$ = RIGHT$(n1$, 1) + LEFT$(n1$, LEN(n1$) - 1)
n2 = VAL(n2$)
IF n2 / n = INT(n2 / n) THEN
IF n2 / n > 1 THEN PRINT n, n2, n2 / n
END IF
n = n + 1
LOOP
|
Posted by Charlie
on 2004-09-23 13:27:56 |