"Is a number prime?"
I do not speak TI-BASIC, so I cannot review the style, coding conventions etc. But there are two possible optimizations:


If a number A is composite then it must have a factor that is less than or
equal to sqrt(A). So you can replace

:While I&lt;A and not(B


with (and I am just guessing the syntax):

:sqrt(A) -&gt; S
:While I&lt;=S and not(B


This  reduces the number of trial divisions substantially  if the input is a prime number.
Check the divisibility by 2 first, and then loop just over the odd numbers
I = 3, 5, 7, .... This saves you from checking

:If I=4
:3-&gt;I


in each loop iteration.