# Prime number

The prime numbers are the natural numbers greater than one that are not products of two smaller numbers.

A prime number (or a prime) is a natural number greater than 1 that cannot be formed by multiplying two smaller natural numbers. A natural number greater than 1 that is not prime is called a composite number. For example, 5 is prime because the only ways of writing it as a product, 1 × 5 or 5 × 1, involve 5 itself.However, 6 is composite because it is the product of two numbers (2 × 3) that are both smaller than 6. Primes are central in number theory because of the fundamental theorem of arithmetic: every natural number greater than 1 is either a prime itself or can be factorized as a product of primes that is unique up to their order.

The property of being prime is called primality. A simple but slow method of checking the primality of a given number ${\displaystyle n}$, called trial division, tests whether ${\displaystyle n}$ is a multiple of any integer between 2 and ${\displaystyle {\sqrt {n}}}$. Faster algorithms include the Miller–Rabin primality test, which is fast but has a small chance of error, and the AKS primality test, which always produces the correct answer in polynomial time but is too slow to be practical. Particularly fast methods are available for numbers of special forms, such as Mersenne numbers. As of December 2018 the largest known prime number has 24,862,048 decimal digits.

There are infinitely many primes, as demonstrated by Euclid around 300 BC. No known simple formula separates prime numbers from composite numbers. However, the distribution of primes within the natural numbers in the large can be statistically modelled. The first result in that direction is the prime number theorem, proven at the end of the 19th century, which says that the probability of a randomly chosen number being prime is inversely proportional to its number of digits, that is, to its logarithm.

Several historical questions regarding prime numbers are still unsolved. These include Goldbach's conjecture, that every even integer greater than 2 can be expressed as the sum of two primes, and the twin prime conjecture, that there are infinitely many pairs of primes having just one even number between them. Such questions spurred the development of various branches of number theory, focusing on analytic or algebraic aspects of numbers. Primes are used in several routines in information technology, such as public-key cryptography, which relies on the difficulty of factoring large numbers into their prime factors. In abstract algebra, objects that behave in a generalized way like prime numbers include prime elements and prime ideals.

## Definition and examples

A natural number (1, 2, 3, 4, 5, 6, etc.) is called a prime number (or a prime) if it is greater than 1 and cannot be written as a product of two natural numbers that are both smaller than it. The numbers greater than 1 that are not prime are called composite numbers.[1] In other words, ${\displaystyle n}$ is prime if ${\displaystyle n}$ items cannot be divided up into smaller equal-size groups of more than one item,[2] or if it is not possible to arrange ${\displaystyle n}$ dots into a rectangular grid that is more than one dot wide and more than one dot high.[3] For example, among the numbers 1 through 6, the numbers 2, 3, and 5 are the prime numbers,[4] as there are no other numbers that divide them evenly (without a remainder). 1 is not prime, as it is specifically excluded in the definition. 4 = 2 × 2 and 6 = 2 × 3 are both composite.

Demonstration, with Cuisenaire rods, that 7 is prime, because none of 2, 3, 4, 5, or 6 divide it evenly

The divisors of a natural number ${\displaystyle n}$ are the numbers that divide ${\displaystyle n}$ evenly. Every natural number has both 1 and itself as a divisor. If it has any other divisor, it cannot be prime. This idea leads to a different but equivalent definition of the primes: they are the numbers with exactly two positive divisors, 1 and the number itself.[5] Yet another way to express the same thing is that a number ${\displaystyle n}$ is prime if it is greater than one and if none of the numbers ${\displaystyle 2,3,\dots ,n-1}$ divides ${\displaystyle n}$ evenly.[6]

The first 25 prime numbers (all the prime numbers less than 100) are:[7]

2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97 (sequence A000040 in the OEIS).

No even number ${\displaystyle n}$ greater than 2 is prime because any such number can be expressed as the product ${\displaystyle 2\times n/2}$. Therefore, every prime number other than 2 is an odd number, and is called an odd prime.[8] Similarly, when written in the usual decimal system, all prime numbers larger than 5 end in 1, 3, 7, or 9. The numbers that end with other digits are all composite: decimal numbers that end in 0, 2, 4, 6, or 8 are even, and decimal numbers that end in 0 or 5 are divisible by 5.[9]

The set of all primes is sometimes denoted by ${\displaystyle \mathbf {P} }$ (a boldface capital P)[10] or by ${\displaystyle \mathbb {P} }$ (a blackboard bold capital P).[11]

Other Languages
Afrikaans: Priemgetal
Alemannisch: Primzahl
Ænglisc: Frumtæl
العربية: عدد أولي
aragonés: Numero primero
অসমীয়া: মৌলিক সংখ্যা
asturianu: Númberu primu
Bân-lâm-gú: Sò͘-sò͘
беларуская: Просты лік
беларуская (тарашкевіца)‎: Просты лік
български: Просто число
bosanski: Prost broj
brezhoneg: Niver kentael
català: Nombre primer
čeština: Prvočíslo
Cymraeg: Rhif cysefin
dansk: Primtal
Deutsch: Primzahl
eesti: Algarv
Ελληνικά: Πρώτος αριθμός
español: Número primo
Esperanto: Primo
euskara: Zenbaki lehen
فارسی: عدد اول
føroyskt: Primtal
français: Nombre premier

хальмг: Экн тойг
한국어: 소수 (수론)
Hawaiʻi: Helu kumu
հայերեն: Պարզ թիվ
hornjoserbsce: Primowa ličba
hrvatski: Prosti broj
Bahasa Indonesia: Bilangan prima
interlingua: Numero prime
italiano: Numero primo
Basa Jawa: Wilangan prima
қазақша: Жай сан
Kiswahili: Namba tasa
Kreyòl ayisyen: Nonm premye
Кыргызча: Жөнөкөй сан
latviešu: Pirmskaitlis
Lëtzebuergesch: Primzuel
Limburgs: Priemgetaal
la .lojban.: nalfendi kacna'u
lumbaart: Numer primm
magyar: Prímszámok
македонски: Прост број
مصرى: عدد اولى
Bahasa Melayu: Nombor perdana
монгол: Анхны тоо
မြန်မာဘာသာ: သုဒ္ဓကိန်း
Nederlands: Priemgetal

Nordfriisk: Primtaal
norsk: Primtall
norsk nynorsk: Primtal
oʻzbekcha/ўзбекча: Tub son
ਪੰਜਾਬੀ: ਅਭਾਜ ਸੰਖਿਆ
پنجابی: پرائم نمبر
Patois: Praim nomba
ភាសាខ្មែរ: ចំនួនបឋម
Piemontèis: Nùmer prim
Plattdüütsch: Primtall
português: Número primo
română: Număr prim
sicilianu: Nùmmuru primu
Simple English: Prime number
slovenčina: Prvočíslo
slovenščina: Praštevilo
ślůnski: Pjyrszo nůmera
Soomaaliga: Tiro mutuxan
српски / srpski: Прост број
srpskohrvatski / српскохрватски: Prost broj
suomi: Alkuluku
svenska: Primtal
தமிழ்: பகா எண்
Türkçe: Asal sayı
українська: Просте число
اردو: مفرد عدد
vèneto: Nùmaro primo
vepsän kel’: Palatoi lugu
Tiếng Việt: Số nguyên tố
Võro: Algarv

West-Vlams: Priemgetal
ייִדיש: פרימצאל

Zazaki: Amaro primal
žemaitėška: Pėrmėnis skaitlios