{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Problem\n\nGiven a [[composite number|008BH74D7R]] $n$, written in binary, find integers $a$ and $b$ with $1 \u003c a, b \u003c n$ and $n = ab$.\nRepeating this step gives the [[prime factorization|02EKEPPJ3R]] of $n$.\nThe open question is whether there is a classical algorithm that does this in a number of bit operations bounded by a polynomial in $\\log n$.\n\n## Remarks\n\nThe prime factorization exists and is unique by the [[existence of prime factorization|020K0X7HVR]] and the [[fundamental theorem of arithmetic|084HH1NDCB]], so the problem is about the cost of finding it.\nTrial division by all integers up to $\\sqrt n$ always works, but it needs about $\\sqrt n$ steps, which is exponential in the number of digits.\nNo polynomial-time classical algorithm is known.\nThe fastest known general method for large numbers is the general number field sieve, whose heuristic running time is\n$$\\exp\\left( \\left( \\sqrt[3]{64/9} + o(1) \\right) (\\ln n)^{1/3} (\\ln \\ln n)^{2/3} \\right).$$\nThe decision version, which asks whether $n$ has a factor $d$ with $1 \u003c d \u003c k$ for a given $k$, lies in both NP and co-NP.\nFor this reason it is not expected to be NP-complete, but this is not proved.\nOn a quantum computer, Shor's algorithm factors $n$ in polynomial time.\nDeciding whether $n$ is prime is easier: the [[AKS primality test|XMHQCDWZW1]] does it in deterministic polynomial time, without finding any factor.\n\n## Explanations\n\n### L1 human\n\nMultiplying two large primes is quick, but recovering the two primes from their product seems to be very slow.\nFor example, $91 = 7 \\cdot 13$ is easy to factor by hand, but a product of two primes with three hundred digits each is beyond every known method.\nThe security of the [[RSA cryptosystem|0HM584C465]] rests on this gap.\nNobody has proved that factoring is really hard, so this remains an open problem.\n",
  "commit": "547b6eddb8f2feb8d579f2d633d22a27b7e132fc",
  "front": {
    "about": [
      "02EKEPPJ3R"
    ],
    "history": {
      "first_stated": "1801",
      "posed_by": "Carl Friedrich Gauss"
    },
    "kind": "problem",
    "msc": [
      "11Y05",
      "11A51",
      "68Q25"
    ],
    "name": "Integer factorization",
    "same_as": {
      "wikidata": "Q4846249",
      "wikipedia": "Integer factorization"
    },
    "sources": [
      {
        "url": "https://en.wikipedia.org/wiki/Integer_factorization"
      }
    ],
    "tag": "YPE65X5HJ4",
    "uses": [
      "008BH74D7R",
      "02EKEPPJ3R",
      "01826KMG2H",
      "020K0X7HVR",
      "0HM584C465",
      "084HH1NDCB",
      "XMHQCDWZW1"
    ]
  },
  "kind": "problem",
  "link": "https://math2.tamnd.com/node/YPE65X5HJ4/",
  "links": [
    {
      "field": "about",
      "target": "02EKEPPJ3R"
    },
    {
      "field": "uses",
      "target": "008BH74D7R"
    },
    {
      "field": "uses",
      "target": "02EKEPPJ3R"
    },
    {
      "field": "uses",
      "target": "01826KMG2H"
    },
    {
      "field": "uses",
      "target": "020K0X7HVR"
    },
    {
      "field": "uses",
      "target": "0HM584C465"
    },
    {
      "field": "uses",
      "target": "084HH1NDCB"
    },
    {
      "field": "uses",
      "target": "XMHQCDWZW1"
    }
  ],
  "markdown": "https://math2.tamnd.com/node/YPE65X5HJ4.md",
  "msc": [
    "11Y05",
    "11A51",
    "68Q25"
  ],
  "name": "Integer factorization",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/YPE/YPE65X5HJ4.md",
  "status": null,
  "tag": "YPE65X5HJ4",
  "uri": "m2://YPE65X5HJ4",
  "url": "https://math2.tamnd.com/wiki/integer-factorization/",
  "writing": {
    "tag": "YPE65X5HJ4",
    "kind": "problem",
    "level": "W0",
    "next": [
      {
        "what": "a source with a locator",
        "have": 0,
        "want": 1
      }
    ]
  }
}
