define limit = 20, loops = 0 dim list[limit] input "loops?", loops for x = 1 to loops let n = x print n, " : ", gosub collectprimefactors for y = 0 to c if list[y] then print list[y], " ", let list[y] = 0 endif next y print "" next x end sub collectprimefactors let c = 0 do if int(n mod 2) = 0 then let n = int(n / 2) let list[c] = 2 let c = c + 1 endif wait loop int(n mod 2) = 0 for i = 3 to sqrt(n) step 2 do if int(n mod i) = 0 then let n = int(n / i) let list[c] = i let c = c + 1 endif wait loop int(n mod i) = 0 next i if n > 2 then let list[c] = n let c = c + 1 endif return