Optimize TI-BASIC Prime Numbers Finder
For factorization, the state of the art (as of like 1999, but also today as far as I know) is something like Rob Gaebler's ABIGSIV: https://www.ticalc.org/archives/files/fileinfo/79/7923.html
The essential idea is to use the &quot;wheel&quot; method. Make a list of all the prime numbers between 1 and 2*3*5*7 and stash that list in L1; then, do trial-division by L1+210*I all at once. The important thing is to maximize the amount of time you spend doing divisions and minimize the amount of time you spend doing bookkeeping.