Prime Number Checker

Determine whether a safe integer is prime or composite and display a concrete factor whenever the entered number is composite.

Check whether an integer is prime

97 is primeNo divisor exists from 2 through √97.

How this tool works

A prime number is an integer of at least two with exactly two positive divisors: one and itself. The checker tests candidate divisors only up to the square root and reports an actual factor when it finds a composite input.

If an integer n has a non-trivial factor, at least one factor is no greater than √n. Testing divisibility through that bound therefore establishes primality for the supported range.

How to use it

  1. Enter a safe integer of two or greater.
  2. Review whether the result is prime or composite.
  3. For composite results, multiply the reported factor pair to verify the classification.

Worked examples

Prime example

Input
97
Output
97 is prime

Testing possible divisors only through the square root finds no exact divisor, which is sufficient to classify 97 as a prime integer.

Composite example

Input
91
Output
91 is composite

Seven divides 91 without a remainder, producing thirteen as the paired factor and proving that the number is not prime.

Limitations

  • The implementation is intended for ordinary safe integers, not cryptographic primes.
  • Values below two are neither prime nor accepted by this checker.