Prime Number Detector
Playing with Numbers · Class VI
Pick a number and check how many divisors it has. Primes have exactly two.
- Number17
- Smallest factor > 117
- Is prime? (1 = yes, 0 = no)1
- Count of divisors2
Formulas in this lab
- Number
- Smallest factor > 1
- Is prime? (1 = yes, 0 = no)
- Count of divisors
Frequently asked questions
▶What is a prime number?
A prime number is a whole number greater than 1 that has exactly two divisors: 1 and itself. So 2, 3, 5, 7, 11 and 13 are primes. The lab checks the smallest divisor of n bigger than 1 to decide if n is prime.
▶How does the prime detector lab work?
Slide n between 2 and 100. The lab finds the smallest factor of n greater than 1 and tells you if n is prime (1 = yes, 0 = no). If the smallest factor equals n itself, the number is prime.
▶Is the year 2027 a prime number?
Yes, 2027 is prime, it has no divisors except 1 and 2027. Indian students often check birth years or roll numbers for fun. While this lab caps at 100, the same idea applies: try every number up to the square root and see if any divides cleanly.
▶Why is 1 not a prime number?
The definition of prime needs exactly two distinct factors, but 1 has only one factor: itself. This is a common slip in school exams. The lab starts n at 2 to avoid this confusion and to focus on the smallest real prime.