Integer Prime Factorization for the TI-86 (85)

This page presents and then demonstrates the use of a TI-86 program called getprime to find the prime factorization of an integer. The program produces a "nice looking" output. In order to do this it uses another program, tostr, to do some formatting. Therefore, tostr must be present on a calculator in order to run getprime.

The following table presents a listing of the tostr program.

Listing of the tostr program
Listing is valid for TI-85 and TI-86
click here to download tostr.85p
click here to download tostr.86p

The getprime program is a bit longer. The table below gives the listing of the getprime program in two parts.

Listing of the getprime program
Listing is valid for TI-85 and TI-86
Part 1
Part 2
click here to download getprime.85p click here to download getprime.86p

The frames below give a demonstration of the use of the getprime program.

Figure 1
Figure 1 shows the PROGRAM menu along with the NAMES submenu. We arrived at this by pressing the key to display the PROGRAM menu, and then the key to select the first menu item, NAMES. The calculator that was used for this demonstration has all of three programs loaded into it. The one we want is GETPRIME, the first few letters of which are shown in the F1 position on the submenu. We press again to select that name and the name is pasted onto the screen. We press to tell the calculator to start the program.
Figure 2
In Figure 2 we have started the program. It asks for the number to be put into prime factorization form. We have pressed to input the value 54. We press the to tell the program to go ahead and start processing.
Figure 3
Figure 3 shows the resulting prime factorization. In this case
54=2 * 33
but the best that the calculator can do is to write this as 2*(3^3). The program is neither done nor computing at this point. Note in Figure 3 that there is a small set of dots in the upper right corner of the screen. On the actual calcualtor that line of dots keeps moving to indicate that the program is in a "PAUSE" state. It is waiting for us to press the key to continue the program.
Figure 4
We have pressed the ENTER key and the calculator responds by asking for another number. In fact, this program is set to continually process numbers. It merely restarts after completing each number.
Figure 5
In Figure 5 we have entered and completed the factorization of one number and we have entered another number. First, we entered 10080 and the calculator computed that the prime factorization is
25*32*5*7
Then we pressed the ENTER key to get the program to ask for another number. This time we entered the value 323646323.
Figure 6
We press the key to start the program working on 323646323. It completes its work and displays the prime factorization of that value. However, the entire prime factorization does not fit on the screen. Notice the three dots at the end of the last line of output. Those dots indicate that there is more to answer, that part of it is off the screen. All we can see is the start of the prime factorization. Fortunately, because the program is in a "PAUSE" condition, we can use the cursor arrows to the display to see the rest of the answer.
Figure 7
We press the key multiple times to shift the "window" of the screen to move one character to the right for each press of the right arrow. Once we reach the end of the answer we will have the the display shown in Figure 7. From Figure 6 and Figure 7 we can determine that the prime factorization of 323646323 is
72*112*132*17*19
Figure 8
As we use the and keys to move the display left and right in Figures 6 and 7, the program is still in a "PAUSE" condition. We press the key to go on to the next input value. At some point we want to stop the program. To do this we press the key. This will interupt the program and give us the screen shown in Figure 9.
Figure 9
From the screen in Figure 9 we have two options. We could press the F1 key to go to edit the program. This option should not be taken. Rather, we will press to quit the program.
Figure 10
In Figure 10 we have left the program. The screen is left with the information that we had when we quit the program. However, at this point we can not use the cursor keys to move to see any more of the prime factorization line.

©Roger M. Palay
Saline, MI 48176
August, 1999