Let n be an integer greater than 1. If all digits of 9997*n are odd, find the smallest
possible value of n.
DEFDBL A-Z
CLS
FOR n = 3 TO 9999 STEP 2
pr = n * 9997
p$ = LTRIM$(STR$(pr))
good = 1
FOR i = 1 TO LEN(p$)
IF INSTR("02468", MID$(p$, i, 1)) > 0 THEN good = 0
NEXT
IF good THEN PRINT n, pr
NEXT
finds
n 9997*n
3335 33339995
3341 33399977
3355 33539935
3361 33599917
3401 33999797
3535 35339395
3541 35399377
3555 35539335
3561 35599317
3601 35999197
4001 39997997
5335 53333995
5341 53393977
5355 53533935
5361 53593917
5401 53993797
5535 55333395
5541 55393377
5555 55533335
5561 55593317
5601 55993197
6001 59991997
|
Posted by Charlie
on 2014-02-24 12:34:01 |