HOME/TOOLS/MATHEMATICS/PRIME NUMBER CHECKER

MATHEMATICS · FREE INSTRUMENT

Prime Number Checker — every division, on display

Type any integer up to 1014 and the verdict lands on the same keystroke: PRIME or COMPOSITE, with the complete trial-division run written out line by line. Sweep any interval for primes with a segmented sieve, break composites into prime factors with τ(n), σ(n) and φ(n) attached — free, exact, and it never leaves your browser.

INSTANT VERDICT FULL TRIAL DIVISION SIEVE OF ERATOSTHENES PRIME FACTORIZATION WORKS OFFLINE
UPDATED · 2025 · RUNS OFFLINE
01

The Instrument

One screen, three questions — is it prime, which primes live between two bounds, and what are the prime factors. Type, and the mathematics happens: verdict, data rows, and the full written proof beneath.

SWS · PRIME-01
INTEGER N

TYPE ANY INTEGER 0 – 1014 · COMMAS WELCOME · THE VERDICT REWRITES ON EVERY KEYSTROKE

FROM
to
UP TO

SEGMENTED SIEVE OF ERATOSTHENES · UPPER BOUND ≤ 1012 · WINDOW ≤ 106 · LEAVE FROM EMPTY TO START AT 1

INTEGER N

PRIME FACTORIZATION BY REPEATED TRIAL DIVISION · N ≤ 1012 · τ, σ, φ INCLUDED

THE WORK — WRITTEN OUTLIVE
INTEGER-EXACT·6K±1 WHEEL·SEGMENTED SIEVE·DETERMINISTIC MILLER–RABIN·OFFLINE
02

How to Use It

Three modes, zero buttons — the checker re-runs on every keystroke and rewrites its own proof. Ninety seconds to learn, forever to keep.

STEP 01 / MODE

Pick the question

CHECK settles a single integer — verdict plus the full trial-division run. RANGE sweeps an interval with a segmented sieve and lists every survivor. FACTOR breaks n into primes and attaches the divisor arithmetic.

CHECK 9973 → prime · every division on record
STEP 02 / INPUT

Type — there is no equals key

Enter any integer from 0 up to 1014 (commas welcome, they're ignored). The screen re-solves live as you type — watch 3,603 fall as composite and 3,607 land as prime one keystroke later.

FACTOR 5040 = 2⁴ × 3² × 5 × 7
STEP 03 / READOUT

Verdict, rows, and the proof

The big line answers; the rows underneath give neighbors, √n, divisions run, τ(n), σ(n), φ(n), twin pairs and density; and the work panel writes each division so the whole run copies straight into your notes.

RANGE 2 → 100 · 25 primes · 8 twin pairs
~/tools/mathematicsWORKED RUN — FACTOR 360
$ prime-number-checker 360 --factor
├── n = 360 · even → 2 dividesd = 2
├── 360 ÷ 2 = 1802¹
├── 180 ÷ 2 = 902²
├── 90 ÷ 2 = 452³
├── 45 ÷ 3 = 153¹
├── 15 ÷ 3 = 53²
├── 5 · no divisor ≤ √5 → prime · stop5¹
└── run complete · 5 exact divisionsτ = 24
360 = 2³ × 3² × 5 · σ = 1170 · φ = 96
03

Questions, Answered

The ones that come up in class, at 2 a.m., and everywhere in between.

Q·01What is a prime number?
A whole number greater than 1 whose only positive divisors are exactly two: 1 and itself. 2, 3, 5, 7, 11, 13… 2 is the only even prime, since every other even number has 2 as a third divisor. Numbers with more than two divisors are composite; 1 has only one and is neither.
Q·02How do I check if a number is prime by hand?
Shortcuts first: even → composite; digit sum a multiple of 3 → composite; ends in 0 or 5 → composite. Then trial-divide by 7, 11, 13… only up to √n. If nothing divides, it's prime. For 89: √89 ≈ 9.4, so you only test 2, 3, 5 and 7 — none divides, so 89 is prime. That's exactly the run this tool writes out for you.
Q·03Is 1 a prime number?
No. Primality demands exactly two divisors, and 1 has just one — itself. It's called the unit. Some old texts listed 1 as prime, but the modern convention protects unique factorization: 6 must equal 2 × 3 in exactly one way, which would break if 1 counted.
Q·04Why only test divisors up to the square root?
If n = a × b with a ≤ b, then a × a ≤ a × b = n, so a ≤ √n. Every composite has a factor at or below its square root; if no candidate ≤ √n divides, no larger one can either. This collapses a 10-digit number from a billion tests to about 31,623 — and the 6k ± 1 wheel removes two-thirds of those.
Q·05How do I find all primes between two numbers?
The Sieve of Eratosthenes: list the integers, strike the multiples of each prime up to √(upper bound), and whatever survives is prime. This tool uses the segmented version — it only sieves base primes up to √(upper) and screens your window directly, so primes near 1012 cost no more than primes near 100.
Q·06What is prime factorization?
Every integer n > 1 is a product of primes in exactly one way, up to order — the fundamental theorem of arithmetic. 360 = 2³ × 3² × 5, and no other prime list multiplies to 360. From it you can read the divisor count τ, the divisor sum σ, and Euler's totient φ — the FACTOR tab computes all three.
Q·07Are there infinitely many primes?
Yes — Euclid proved it around 300 BC: assume a complete list, multiply every prime on it and add 1; the result is divisible by none of them, so either it's prime or it has a new prime factor. Contradiction. The primes also thin out predictably: π(n) ≈ n / ln n.
Q·08What are twin primes?
Prime pairs separated by exactly 2: (3, 5), (5, 7), (11, 13), (17, 19), (29, 31)… Whether infinitely many exist is the twin prime conjecture — open since 1846 — though it's now proven that prime gaps of at most 246 occur infinitely often. The RANGE tab counts the twin pairs in your window.
Q·09What is the largest known prime?
282,589,933 − 1, a Mersenne prime with 24,862,048 digits, found by the GIMPS project in December 2018. It's only the largest known, never the largest — Euclid forbids a largest. Mersenne primes dominate the record books because the Lucas–Lehmer test checks them so efficiently.
Q·10Is the checker free — does my number leave the page?
Free, no sign-up, no locked features. Every division runs locally in your browser with integer-exact arithmetic, nothing is recorded or transmitted, and the page keeps working offline once it has loaded.