(In reply to
Solution by Jer)
The following program runs on an Android phone, using an available app, Basic, from Mintoris, in the Play Store, that is used to interpret it. It factors 8888888899999999 in under a second, much faster apparently than the calculator program, and I'd think the program entry is no more tedious than entering a program on say a TI-84.
The number in question is at about the limit of the available accuracy.
1 INPUT n
PRINT n
prev = 2 * n
limit = CEIL(SQRT(n))
dv = 2
GOSUB 10000
dv = 3
GOSUB 10000
dv = 5
GOSUB 10000
dv = 7
100 GOSUB 10000
dv = dv + 4
GOSUB 10000
dv = dv + 2
GOSUB 10000
dv = dv + 4
GOSUB 10000
dv = dv + 2
GOSUB 10000
dv = dv + 4
GOSUB 10000
dv = dv + 6
GOSUB 10000
dv = dv + 2
GOSUB 10000
dv = dv + 6
IF dv <= limit THEN 100
IF n > 1 THEN
PRINT
PRINT n;
ENDIF
PRINT
WAIT
CLS
GOTO 1
10000 q = INT(n / dv)
IF q * dv <> n OR n <= 0 THEN 10200
n = q
IF dv <> prev THEN PRINT
IF dv = prev THEN PRINT ",";
PRINT dv;
prev = dv
IF n > 0 THEN limit = CEIL(SQRT(n))
IF n = 0 THEN limit = 0
GOTO 10000
10200 RETURN
The line numbers were left over from translation from Applesoft Basic on an Apple ][+ computer.
|
Posted by Charlie
on 2019-03-19 11:37:55 |