Key takeaways
- Integer factoring is in both NP and co-NP, so it cannot be NP-complete unless NP equals co-NP, which most researchers believe is false.
- No polynomial-time classical factoring algorithm is known; the number field sieve runs in heuristic time L[1/3, 1.923], and the best proved bound since 1992 was L[1/2, 1].
- Shor's 1995 algorithm puts factoring in BQP, which is why NIST published post-quantum standards to replace RSA.
No one knows whether factoring is NP-hard, and most complexity theorists think it is not. Integer factoring sits in both NP and co-NP, and Scott Aaronson's survey of the P vs NP problem spells out the consequence: factoring "can't be NP-complete unless NP = coNP," a collapse almost no one expects. It is also not known to be in P. It is one of the rare problems believed to sit in between.
The question is getting searched again because of a busy news day. On November 25, 2026, Google researchers posted papers credited to Cogentic, an AI system built on Gemini 4, including one titled Unconditional Integer Factorization in Time LN[1/3, O(1)]. A Reddit rumor the same day said AI labs had put factoring in P. None of the Cogentic papers claims that. Our article on the Cogentic papers covers what they do claim.
What NP, co-NP and NP-hard mean
These are classes of yes-or-no questions, so complexity theorists use a yes-or-no version of factoring. Aaronson's survey defines it as: given N and k, does N have a divisor bigger than 1 and at most k? A fast answer to that question gives a fast way to find the full factorization, by binary search, and the reverse also holds.
- NP holds the questions where a "yes" comes with a proof you can check quickly. For factoring, the proof is the divisor itself. Multiply and you're done.
- co-NP holds the questions where a "no" comes with a quick proof. For factoring, the proof is the complete prime factorization of N, showing every prime in it is bigger than k. Primality can be checked in polynomial time, so the whole certificate is easy to verify.
- NP-hard means every problem in NP reduces to it. An NP-hard problem is at least as hard as anything in NP, including classic hard ones such as 3SAT, the problem of satisfying a logical formula.
The Complexity Zoo, the standard catalog of complexity classes, lists factoring under NP ∩ co-NP.
Why factoring is probably not NP-hard
Being in both NP and co-NP is what makes NP-hardness unlikely. Aaronson's survey gives the short argument. If a problem in NP ∩ co-NP were NP-complete, every NP problem could be solved with its help while still producing checkable proofs for both "yes" and "no" answers. That would put all of NP inside co-NP, so NP would equal co-NP, and the whole polynomial hierarchy, a tower of ever-harder classes, would collapse to NP.
Most researchers believe NP and co-NP are different, so they also believe factoring is not NP-hard. That belief is a conjecture, not a theorem. Nobody has proved NP ≠ co-NP, just as nobody has proved P ≠ NP.
Is factoring in P
Not as far as anyone knows. No one has a polynomial-time classical algorithm for factoring, and no one has proved one can't exist. The Complexity Zoo describes the decision version of factoring as a problem thought to be NP-intermediate: in NP, but neither in P nor NP-complete. Aaronson's survey adds the obvious caveat: that belief holds only if factoring isn't simply in P.
Factoring speeds are measured on a scale written LN[α, c]. An α of 1 means exponential time, hopeless for large numbers. An α of 0 means polynomial time, which is what "in P" would require. Everything in between is subexponential, and that is where every known classical method sits.
The fastest classical algorithms
The general number field sieve is the method used for record factorizations. Its running time is LN[1/3, (64/9)1/3], with (64/9)1/3 about 1.923, as Emmanuel Thomé's number field sieve lecture for UC San Diego derives. That figure is heuristic. It assumes certain values behave like random integers when it comes to having only small prime factors, an assumption no one has proved.
The best bound anyone had proved was weaker. In a 1992 paper in the Journal of the American Mathematical Society, Hendrik Lenstra Jr. and Carl Pomerance gave a randomized algorithm that factors any integer in expected time LN[1/2, 1+o(1)]. Their abstract notes the gap between that rigorous bound and the sieve's conjectured LN[1/3].
The Cogentic paper claims to close that gap. Its abstract describes a randomized algorithm that always returns the correct factorization in expected time LN[1/3, 105], with no unproven assumptions. Even if the proof holds up, α is still 1/3, not 0. That is subexponential, not polynomial, so it says nothing about factoring being in P. Aaronson wrote in a comment on his blog on November 25 that he saw "nothing of practical relevance for cryptography" in the Google factoring papers. The paper has not been peer reviewed.
What quantum computers change
In 1995 Peter Shor posted a paper showing that a quantum computer could factor integers and compute discrete logarithms in a number of steps polynomial in the number of digits. In complexity terms, factoring is in BQP, the class of problems a quantum computer solves efficiently with bounded error, and the Complexity Zoo's BQP entry lists it there.
This does not make factoring NP-hard, and it does not mean quantum computers can solve NP-complete problems. Aaronson's survey notes that Shor's algorithm uses very special properties of factoring that are not known or believed to hold for NP-complete problems.
Why RSA depends on it
RSA encryption and signatures are safe only if factoring a large number built from two secret primes is hard. Aaronson's survey points out that public-key cryptography rests on conjectures that go beyond P ≠ NP: a proof that P ≠ NP would not by itself show factoring is hard. And because factoring is probably not NP-hard, breaking RSA would not solve every NP problem either.
The practical threat is quantum. Shor's algorithm would break RSA on a large enough quantum computer, which is why NIST released its first post-quantum cryptography standards in August 2024: FIPS 203 (ML-KEM), FIPS 204 (ML-DSA) and FIPS 205 (SLH-DSA). NIST says it will deprecate and remove quantum-vulnerable algorithms from its standards by 2035.
The things to watch now are whether number theorists confirm the Cogentic proof and whether any lab publishes an algorithm that actually lowers α below 1/3. Neither would settle whether factoring is NP-hard.
Frequently asked questions
Is factoring in P?
Not as far as anyone knows. No polynomial-time classical algorithm for factoring is known, and no one has proved that one cannot exist.
Is factoring in NP?
Yes. A divisor of N is a proof that can be checked quickly by division, and the full prime factorization proves the 'no' answers too, which puts factoring in co-NP as well.
Is factoring NP-complete?
It is not known to be, and it is very unlikely. Because factoring is in NP and co-NP, it being NP-complete would imply NP equals co-NP.
Did Google's Cogentic paper put factoring in P?
No. The Cogentic paper posted on November 25, 2026 claims a proved expected running time of L_N[1/3, 105], which is subexponential, not polynomial. It has not been peer reviewed.
Sources
- P =? NPScott Aaronson
- Complexity Zoo: N (NP ∩ coNP, NPI)Complexity Zoo
- Complexity Zoo: B (BQP)Complexity Zoo
- Polynomial-Time Algorithms for Prime Factorization and Discrete Logarithms on a Quantum ComputerarXiv
- A rigorous time bound for factoring integersJournal of the American Mathematical Society
- CSE291-14: The Number Field SieveEmmanuel Thomé, UC San Diego
- Cogentic research papersGoogle Research
- Post-Quantum CryptographyNIST
- Holy shit holy shit holy shit holy shitShtetl-Optimized


