Mathematics · pattern A, Numeric fields
Enter a number to test for primality, with its full factorisation, divisor list and divisor sum where it turns out to be composite.
a prime has exactly two divisors: 1 and itself
Trial division only needs to reach the square root, because any factor above it pairs with one below.
Prime
997 has no divisors other than 1 and itself.
1divide by 997
trial division by successive primes until the quotient is 1
If n has a factor larger than √n, its cofactor is smaller than √n and would already have been found. That is why checking a four-digit number by hand is quick, and why primality testing scales as well as it does.
If the number is not the part you are stuck on, that is what the service is for — a specialist who explains the working, not just the answer.
Arithmetic runs in double-precision floating point, so results beyond about fifteen significant figures are not exact. Where a question wants an exact fraction or surd, keep the exact form rather than a decimal.