Prime factorization and divisors — a TI-89 Titanium program
PRIME89 is a TI-89 BASIC program for the TI-89 Titanium. Factors a whole number into primes as a string like 2^3*3^2*5, and gives the number of divisors, the sum of divisors, and whether it is prime.
What it asks for and what it shows
It asks for 1 value at its prompts. In the example below it shows DIVISORS, SUM DIV, 2^3*3^2*5, COMPOSITE.
Example run
One of its oracle test cases: “360 = 2^3*3^2*5”. The inputs are typed in order, and the results are the values the case expects on the screen.
| Step | Value |
|---|---|
| You enter | |
| Input 1 | 360 |
| The screen shows | |
DIVISORS= | 24 |
SUM DIV= | 1170 |
| Text | 2^3*3^2*5 |
| Text | COMPOSITE |
How it's checked
5 test cases, each checked against an independent method. Replayed key by key on a virtual TI-89 Titanium, they make 28 checks.
How E-Code checks every program
Run it or put it on your calculator
- Open the library in the TI-89 Titanium calculator and pick “Prime factorization and divisors” (PRIME89).
- Put it on your own calculator with a computer and a USB cable, or type it in by hand.
Related programs
- Quadratic roots, exact when possible
- Linear system, exact answers
- Fraction calculator: exact, mixed, decimal
- LU decomposition with pivoting (exact)
- Matrix inverse, exact
All TI-89 Titanium math programs · All TI-89 Titanium programs