Find a 13 digit positive integer N whose base ten representation consists entirely of 8s and 9s
such that 213 divides N.
DECLARE SUB vary (psn#)
DEFDBL A-Z
DIM SHARED bse
bse = 8888888888888#
vary 0
SUB vary (psn)
addend = INT(10 ^ psn + .5)
modval = bse
q = INT(bse / 8192)
r = bse - q * 8192
IF r = 0 THEN PRINT bse
IF psn < 12 THEN vary psn + 1
bse = bse + addend
modval = bse
q = INT(bse / 8192)
r = bse - q * 8192
IF r = 0 THEN PRINT bse
IF psn < 12 THEN vary psn + 1
bse = bse - addend
END SUB
gives
8898989989888
|
Posted by Charlie
on 2011-12-21 12:41:17 |