Math Lab

Prime Number Detector

Playing with Numbers · Class VI

Pick a number and check how many divisors it has. Primes have exactly two.

17
type a value
2100
Live values
  • Number17
  • Smallest factor > 117
  • Is prime? (1 = yes, 0 = no)1
  • Count of divisors2
Live readout
Number17
Smallest factor > 117
Is prime? (1 = yes, 0 = no)1
Count of divisors2
Number n17

Formulas in this lab

  • Number
    nn
  • Smallest factor > 1
    smallest divisor of n\text{smallest divisor of } n
  • Is prime? (1 = yes, 0 = no)
    [prime(n)][\text{prime}(n)]
  • Count of divisors
    d(n)d(n)
Tip: If the smallest factor > 1 equals n itself, then n is prime.

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.