{
  "id": "composite-number",
  "title": "Composite Number",
  "lang": "en",
  "source_lang": "en",
  "summary": "A composite number is a positive integer greater than 1 that has a positive divisor other than 1 and itself.",
  "category": "mathematics",
  "subcategory": "algebra",
  "type": "concept",
  "aliases": [
    "Composite integer"
  ],
  "generated_at": "2026-11-03",
  "model": "pro/gpt-6.1-sol",
  "url": "https://aiwiki.page/en/composite-number/",
  "translations": {
    "zh-Hans": {
      "url": "https://aiwiki.page/zh/composite-number/",
      "json": "https://aiwiki.page/zh/composite-number.json"
    }
  },
  "sections": [
    {
      "heading": "",
      "text": "A composite number is a positive integer greater than 1 that can be expressed as the product of two smaller positive integers. Equivalently, it has a positive divisor other than 1 and itself. Composite numbers contrast with prime numbers, which have exactly two positive divisors. Every integer greater than 1 belongs to exactly one of these two classes. Their distinction is fundamental to number theory."
    },
    {
      "heading": "Definition and examples",
      "text": "An integer \\(n>1\\) is composite if there exist integers \\(a\\) and \\(b\\) such that\n\n\\[n=ab,\\qquad 1<a<n,\\qquad 1<b<n.\\]\n\nThe first composite numbers are\n\n\\[4,\\ 6,\\ 8,\\ 9,\\ 10,\\ 12,\\ 14,\\ 15,\\ 16,\\ 18,\\ 20,\\ 21,\\ 22,\\ 24,\\ 25,\\ldots\\]\n\nFor example, \\(12=3\\cdot4\\), so 12 is composite. Its positive divisors are \\(1,2,3,4,6,12\\). The number 9 is composite because \\(9=3\\cdot3\\): the two factors need not be distinct.\n\nThe smallest composite number is 4. Every even integer greater than 2 is composite because it is divisible by 2, but composites can also be odd, as 9, 15, and 25 demonstrate.\n\nThe number 1 is neither prime nor composite, since it has only one positive divisor. Zero and negative integers are also excluded from the standard definition. Whether a convention includes zero among the natural numbers does not affect this classification."
    },
    {
      "heading": "Prime factorization",
      "text": "The fundamental theorem of arithmetic states that every integer greater than 1 has a factorization into primes that is unique apart from the order of its factors. Thus any such integer can be written as\n\n\\[n=p_1^{a_1}p_2^{a_2}\\cdots p_r^{a_r},\\]\n\nwhere the \\(p_i\\) are distinct primes and the \\(a_i\\) are positive integers.\n\nThe number \\(n\\) is composite precisely when\n\n\\[a_1+a_2+\\cdots+a_r\\geq2.\\]\n\nThis counts prime factors with multiplicity. For example,\n\n\\[72=2^3\\cdot3^2\\]\n\nhas five prime factors counted with multiplicity, but only two distinct prime factors.\n\nThe number of positive divisors of \\(n\\), usually denoted by \\(\\tau(n)\\), is\n\n\\[\\tau(n)=(a_1+1)(a_2+1)\\cdots(a_r+1).\\]\n\nEach divisor is obtained by independently choosing an exponent between 0 and \\(a_i\\) for each prime \\(p_i\\). Consequently, an integer greater than 1 is composite exactly when it has more than two positive divisors.\n\nImportant types\n\nSeveral classes describe the factorization structure of composite numbers:\n\n- A semiprime is a product of exactly two primes, counted with multiplicity. Examples include \\(6=2\\cdot3\\), \\(9=3^2\\), and \\(35=5\\cdot7\\).\n- A prime power has the form \\(p^k\\), with \\(p\\) prime. It is composite when \\(k\\geq2\\).\n- A squarefree composite number has no repeated prime factor. For example, \\(30=2\\cdot3\\cdot5\\) is squarefree, whereas \\(12=2^2\\cdot3\\) is not.\n\nThese classes overlap: 6 is both semiprime and squarefree, while 9 is both semiprime and a prime power."
    },
    {
      "heading": "Detecting compositeness",
      "text": "Trial division\n\nEvery composite integer \\(n\\) has a prime divisor no greater than \\(\\sqrt n\\). To see this, write \\(n=ab\\) with \\(1<a\\leq b\\). Then \\(a^2\\leq n\\), so \\(a\\leq\\sqrt n\\); at least one prime divisor of \\(a\\) is therefore also no greater than \\(\\sqrt n\\).\n\nThis gives a basic test: divide \\(n\\) by each prime not exceeding \\(\\sqrt n\\). Finding any such divisor proves that \\(n\\) is composite. If none divides \\(n\\), then \\(n\\) is prime.\n\nFor example, to test 91, only the primes 2, 3, 5, and 7 need consideration. Since \\(91=7\\cdot13\\), it is composite.\n\nTrial division is effective for small numbers but becomes expensive for large inputs. Its worst-case running time grows exponentially in the number of digits of the input.\n\nSieving and primality tests\n\nThe sieve of Eratosthenes identifies primes up to a chosen bound by marking composite numbers as multiples of smaller primes. When processing a prime \\(p\\), marking can begin at \\(p^2\\), because smaller multiples of \\(p\\) already have smaller prime factors.\n\nFor large individual integers, primality tests can determine whether a number is prime without finding its factors. Many use modular arithmetic. A failed necessary condition for primality proves compositeness; passing a particular test need not prove primality unless that test provides a conclusive criterion.\n\nEstablishing that a number is composite and finding its factors are distinct computational tasks. A test can demonstrate compositeness without revealing a nontrivial divisor."
    },
    {
      "heading": "Distribution",
      "text": "There are infinitely many composite numbers: the even integers greater than 2 already form an infinite family.\n\nThere are also arbitrarily long runs of consecutive composite integers. For any integer \\(m\\geq2\\), consider\n\n\\[(m+1)!+2,\\ (m+1)!+3,\\ \\ldots,\\ (m+1)!+(m+1),\\]\n\nwhere the exclamation mark denotes a factorial. Each term \\((m+1)!+k\\) is divisible by \\(k\\) and greater than \\(k\\), so these are \\(m\\) consecutive composite numbers. This construction proves the existence of long runs, but generally does not produce the earliest such run.\n\nComposite numbers have natural density 1 among the positive integers. If \\(\\pi(x)\\) counts the primes not exceeding \\(x\\), the number of composites not exceeding \\(x\\), for \\(x\\geq2\\), is\n\n\\[\\lfloor x\\rfloor-1-\\pi(x).\\]\n\nThe prime number theorem gives \\(\\pi(x)\\sim x/\\log x\\), so the proportion of integers up to \\(x\\) that are composite tends to 1 as \\(x\\) increases. This does not mean that primes eventually stop occurring."
    },
    {
      "heading": "Historical and computational significance",
      "text": "The distinction between prime and composite numbers appears in ancient Greek mathematics. Book VII of Euclid’s *Elements* defines a composite number as one measured by some number, using “measured” in the sense of exact divisibility.\n\nIn modern computation, integer factorization concerns decomposing an integer into factors, ultimately into primes. Multiplying known factors is computationally straightforward, whereas factoring a sufficiently large product of suitably chosen primes can be much harder with known classical methods.\n\nThis distinction underlies RSA, whose public modulus is typically the product of two large distinct primes. Factoring that modulus permits recovery of the private key in standard RSA. Compositeness alone does not imply computational difficulty: integers with small prime factors or special algebraic structure may be easy to factor."
    }
  ],
  "links": [
    "integer",
    "prime-number",
    "number-theory",
    "natural-number",
    "fundamental-theorem-of-arithmetic",
    "semiprime",
    "sieve-of-eratosthenes",
    "primality-test",
    "modular-arithmetic",
    "factorial",
    "prime-number-theorem",
    "euclids-elements",
    "rsa-cryptosystem"
  ],
  "sources": [],
  "license": "https://creativecommons.org/licenses/by/4.0/"
}