First N Primes Generator
List the first N prime numbers using the Sieve of Eratosthenes. Useful for number-theory exercises, educational cryptography demos and algorithm testing. Runs in your browser.
Lista dos N primeiros números primos, calculados via crivo de Eratóstenes no navegador.
Total: — · Maior: —
—
The first prime numbers, generated by sieve
A prime is a number greater than 1 divisible only by 1 and itself. The list starts 2, 3, 5, 7, 11 — and 2 is the only even one, which already explains why it turns up separately in almost every proof. Euclid showed over two thousand years ago that the list never ends, with an argument that fits in three lines: multiply all known primes, add 1, and the result is either prime or has a prime factor that was not on the list.
Enter how many primes you want and the page generates the sequence with the sieve of Eratosthenes, the right method for producing many primes at once: instead of testing each number, it strikes out the multiples of each prime found. The upper bound of the search comes from the prime number theorem, which estimates where the nth prime will be — without that estimate you would have to guess a ceiling and hope it fits.
One thing the list makes visible is how irregular the gaps are. Between 2 and 3 the distance is 1, between 89 and 97 it is 8, and arbitrarily long stretches exist with no primes at all. At the same time, twin primes — pairs two apart, like 11 and 13 — keep showing up as far as anyone has looked, though nobody has managed to prove they appear forever.
Frequently asked questions
Why is 1 not prime?
Why is the sieve better than testing one by one?
How many primes are there below a given number?
Related Tools
Perfect Number Generator
List perfect numbers (where the sum of proper divisors equals the number itself) below a ceiling. Examples: 6, 28, 496, 8128.
Fibonacci Generator (first N)
Generate the first N Fibonacci numbers using BigInt for overflow-free output. Useful for didactics, algorithm testing and series analysis.
Prime Factorization Generator
Decompose N into prime factors with exponents (e.g., 360 = 2³·3²·5). Useful for LCM, GCD and number theory.
Divisors Generator
List all positive divisors of N. Shows total count and whether N is prime (only 2 divisors) or perfect.
CSS Specificity Calculator
Compute the specificity (a, b, c) of a CSS selector — IDs, classes/attributes/pseudo-classes, elements. Useful to understand why your rule is not applying. Everything in your browser.
Bash/Zsh Aliases Generator
Predefined list of useful aliases (ll, la, gs, gd, gco, mkcd, ip) ready to paste into .bashrc or .zshrc.