Every integer can be expressed as a unique product of prime numbers. If a number n is composite, it will have a prime factor less than or equal to √n. To find prime factors of a number n, we first try dividing n by 2. Then, try dividing n by each of...
Every integer can be expressed as a unique product of prime numbers. If a number n is composite, it will have a prime factor less than or equal to √n. To find prime factors of a number n, we first try dividing n by 2. Then, try dividing n by each of the odd integers less than or equal to √n. Once one prime factor p is found, do division on n/ p. This method is one of the most efficient methods for factoring small integers(say less than 10,000,000,000). In this paper, we create a function named factors that can implement the above division algorithm in Web Script and using the factors function we construct three interactive HTML Calculators: Prime Factorization Calculator, Primality Testing Calculator, and Prime Array Calculator.