10 DIM FA(254)
20 INPUT "DESIRED INTEGER";IN
30 IN=ABS(INT(IN)):IF IN=0 THEN END
40 OI=IN:PR=3:T1=TIMER
50 IF OI>2 AND IN>1 AND IN/2=INT(IN/2) THEN IN=IN/2:NF=NF+1:FA(NF)=2:GOTO 50 ELSE 60
60 OF=NF:FOR I=PR TO IN^.5 +1 STEP 2
70 IF IN/I<>INT(IN/I) THEN 90
80 IN=IN/I:NF=NF+1:FA(NF)=I
90 IF OF<NF THEN PR=I:GOTO 60 ELSE NEXT
100 T2=TIMER
110 IF NF=0 THEN PRINT USING "#########";IN;:PRINT "is prime":GOTO 140
120 FOR I=1 TO NF:PRINT FA(I);:NEXT
130 IF IN>1 AND NF>0 THEN PRINT IN
140 PRINT "calculations took";:PRINT USING "#####.###";T2-T1;:PRINT "seconds":RUN
