"PRIME FACTORS"

{0}→List X:1→I

"N"?→N

While Frac(N÷2)=0

N÷2→N

2→List X[I]

Isz I

WhileEnd

While Frac(N÷3)=0

N÷3→N

3→List X[I]

Isz I

WhileEnd

5→F

While F≤√(N)

While Frac(N÷F)=0

N÷F→N

F→List X[I]

Isz I

WhileEnd

F+2→F

While Frac(N÷F)=0

N÷F→N

F→List X[I]

Isz I

WhileEnd

F+4→F

WhileEnd

N≠1=>N→List X[I]

If N=1

Then I-1→I

IfEnd

Cls

For 1→J To I

List X[J]◣

Next

If I=1

Then " PRIME"

Else

"SEE MODE 3:SD"

IfEnd

-------------------------------------

Example:

N = 6666666667

19

1627

215659

The result will also be available in MODE 3:SD

Takes about 25 s

---------------------------------------

N=215659

215659

PRIME

**Edited by secutor, 20 June 2018 - 11:06 AM.**