E-Code

Prime factorization and divisors — a TI-89 Titanium program

By E-Code · updated

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.

StepValue
You enter
Input 1360
The screen shows
DIVISORS=24
SUM DIV=1170
Text2^3*3^2*5
TextCOMPOSITE

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

Related programs

All TI-89 Titanium math programs · All TI-89 Titanium programs