Paper check About

PRIMES Is in P

2004 · paper · Computer science

Presents a deterministic polynomial-time algorithm that decides whether a number is prime or composite, with a running time of about (log n)^12. The correctness proof uses only simple algebra, apart from one result on the density of certain primes.

Checked: PDF from cse.iitk.ac.in, fetched 4 Oct 2026. Page numbers are those of that PDF.

6 findings

Reference or label [GK86] reads "In Proceedings of Annual IEEE Symposium on Foundations of Computer Science, pages 316–329, 1986". The Goldwasser–Kilian paper appeared in ACM STOC 1986.
  • p. 9 References, [GK86]
    Proceedings of Annual IEEE Symposium on Foundations of Computer Science, pages 316–329, 1986.
  • p. 9 Reference list, [GK86]
    In Proceedings of Annual IEEE Symposium on Foundations of Computer Science, pages 316–329, 1986.

Only the authors can say what is right here.

Judge's note: Rests on outside knowledge: 'Almost all primes can be quickly certified' was published in the Proceedings of the 18th ACM STOC (1986), pp. 316–329, not IEEE FOCS. The page 9 image shows the FOCS wording exactly as quoted, and it is the same wording as the [AB99] entry.

Second check: another model agreed

Report a problem with this finding
Wording Page 2 refers to "the correctenss proofs of deterministic algorithms of [APR83, GK86, Atk86]", but page 1 calls GK86 "a randomized algorithm based on Elliptic curves running in expected polynomial-time" and Atkin's [Atk86] "a similar algorithm".
  • p. 2 Section 1, para 'The ultimate goal'
    the correctenss proofs of deterministic algorithms of [APR83, GK86, Atk86] are much more complex
  • p. 1 Section 1, last paragraph
    Goldwasser and Kilian [GK86] proposed a randomized algorithm
  • p. 2 Introduction, para 2
    correctenss proofs
  • p. 2 Introduction, para 1
    the correctenss proofs of deterministic algorithms

Only the authors can say what is right here.

Judge's note: Compared the page 1 and page 2 images. Page 1 calls GK86 randomized (expected polynomial time) and calls Atk86 similar to it. Page 2 groups both with APR83 as 'deterministic algorithms'. The paper's own descriptions are inconsistent. The intended word (e.g. primality-proving) is for the authors to say. The misspelling 'correctenss' in the same sentence is handled separately as C004.

Second check: another model agreed

Report a problem with this finding
Wording Proof of Identity (1), p.2: "For 0 < i < p, the coefficient of x^i in ((x − a)^p − (x^p − a)) is (−1)^i (p choose i) a^{p−i}". By the binomial theorem the coefficient is (−1)^{p−i} (p choose i) a^{p−i}, so the sign is wrong whenever p is odd.
  • p. 2 Proof of Identity (1), first sentence
    For 0 < i < p, the coefficient

Only the authors can say what is right here.

Judge's note: Checked the crop of p.2. My working: (x−a)^p = Σ C(p,i) x^i (−a)^{p−i}, so the coefficient of x^i is (−1)^{p−i} C(p,i) a^{p−i}. Subtracting x^p − a changes only the x^p and x^0 terms. For odd p, (−1)^{p−i} = −(−1)^i. Counterexample: p=9, a=1, i=3 (a is coprime to p, and the proof covers composite p). The true coefficient is +84 and the printed formula gives −84. These also differ mod 9 (3 vs 6). The proof only uses whether coefficients are zero or nonzero mod p, and a sign does not change that, so the identity and the rest of the proof stand. This is a faulty step under a stated result that still holds, so S3.

Second check: another model agreed

Report a problem with this finding
Wording Proof of the Identity: "For 0 < i < p, the coefficient of x^i in ((x − a)^p − (x^p − a)) is (−1)^i (p choose i) a^{p−i}". By the binomial theorem the sign is (−1)^{p−i}.
  • p. 2 Section 2, proof of Identity
    the coefficient of x^i in ((x − a)^p − (x^p − a)) is (−1)^i

Only the authors can say what is right here.

Judge's note: Read on page 2 image. My working: (x−a)^p = sum_i C(p,i) x^i (−a)^{p−i}, so the coefficient of x^i is (−1)^{p−i} C(p,i) a^{p−i}. Check with p=3, i=1: (x−a)^3 = x^3 − 3a x^2 + 3a^2 x − a^3, so the coefficient of x is +3a^2, while the printed formula gives −3a^2. For odd p the two signs differ. The proof only uses whether the coefficient vanishes mod p, so the stated Identity stands.

Second check: another model agreed

Report a problem with this finding
Wording Proof of Theorem 5.1, p.7: "The first step (gcd computation) takes poly(log log r) asymptotic time." Computing gcd(n, r) in the bit model needs at least Ω(log n) bit operations, because n must be read or reduced mod r, so poly(log log r) cannot bound this step.
  • p. 7 Proof of Theorem 5.1
    The first step (gcd computation) takes poly(log log r) asymptotic time.
  • p. 7 Theorem 5.1 proof
    takes poly(log log r) asymptotic time
  • p. 7
    (gcd computation) takes poly(log log r) asymptotic time.

Only the authors can say what is right here.

Judge's note: Checked the crop of p.7. In step 4 of the algorithm, gcd(n,r) is computed afresh for each r (text p.3/4, line 211). In the bit-operation model used elsewhere in the proof, this needs at least reading n, which is Ω(log n). Even after reducing n mod r it costs about Õ(log n · log r). The bound poly(log log r) = poly(log log log n) is therefore too small. The other steps in the same paragraph are costed with log log n, which suggests a slip. Charging Õ(log n) per iteration over O(log^6 n) iterations gives Õ(log^7 n). That is still below the stated Õ(log^9 n) for the while loop, so Theorem 5.1 stands, hence S3. One reviewer's 'repeated log' flag is a text-rule artefact: 'log log' is intended notation, not a duplicated word.

Second check: another model agreed, code check

Report a problem with this finding
Wording Section 6, p.8: "the product of prime numbers less than x is at least e^x (see [Apo97])". This is false as stated: for example, the product of primes less than 10 is 210, while e^10 ≈ 22026.
  • p. 8 Section 6, paragraph after Conjecture
    the product of prime numbers less than x is at least e^x (see [Apo97])
  • p. 8 Section 6, justification of the search interval [2, 4 log n]
    the product of prime numbers less than x is at least e^x

Only the authors can say what is right here.

Judge's note: Checked the full p.8 image; the sentence is printed as quoted. Products of small primes show the inequality is false: at x=10 the product is 2·3·5·7 = 210 < e^10 ≈ 22026. In general the product is e^{θ(x)}, with θ(x) < x across checked ranges. The argument needs only a Chebyshev-type bound, for example a product of primes ≤ 4 log n of at least 2^{4 log n} = n^4 > n^2 − 1 for large n. With that bound, an r in [2, 4 log n] not dividing n^2 − 1 still exists, and the conditional Õ(log^3 n) claim stands. The printed justification step is false, but the result it supports survives, so S3, author_query. Which bound Apostol actually states is outside the files and was not checked.

Second check: another model agreed

Report a problem with this finding
12 minor (typos and the like; most checked by the judge only)
Reference or label Lemma 5.3 and its proof cite "the conjecture 5" ("Assuming the conjecture 5", "By the conjecture 5"), but the conjecture is printed unnumbered as "Conjecture. [HL22]".
  • p. 7 Lemma 5.3 statement and proof
    Assuming the conjecture 5
  • p. 7 Lemma 5.3 proof
    By the conjecture 5, there are
  • p. 7 Proof of Lemma 5.3
    By the conjecture 5

Judge's note: On page 7 the only conjecture in Section 5 is headed 'Conjecture. [HL22]' with no number. The numbered items are Theorem 5.1, Definition 5.2 and Lemma 5.3, and the Section 6 conjecture is also unnumbered. So the label points to nothing. The intended referent (the Section 5 conjecture) is still clear.

Second check: another model agreed

Report a problem with this finding
Wording In the proof of the Identity in Section 2, p may be composite ("If p is composite: ..."), yet the proof concludes "is not identically zero over F_p". Section 3 says F_{p^d} denotes a finite field "where p is a prime".
  • p. 2 Section 2, proof of Identity
    is not identically zero over Fp
  • p. 2 Section 3, first paragraph
    denotes the finite field, where p is a prime

Judge's note: Page 2 image: in the composite case Z_p is not a field, so 'F_p' is a notational slip; Z_p (or 'mod p') is meant. The argument is unaffected. Section 2 is an informal overview, so this is a minor consistency point.

Second check: another model agreed

Report a problem with this finding
Wording The conjecture gives the count as "Dx/log^2 x" with D ≈ 0.6601618 (the twin prime constant), but page 2 fixes "log will be to base 2". With base-2 logs the constant should be about 0.317 rather than 0.660.
  • p. 7 Conjecture before Lemma 5.3
    where D is the twin prime constant (estimated by Wrench and others to be approximately 0.6601618...)
  • p. 2 Section 3
    Unless stated otherwise, log will be to base 2 in this paper.

Only the authors can say what is right here.

Judge's note: Rests on outside knowledge: the Hardy–Littlewood prediction that #{p<=y: p, 2p+1 prime} ~ 2*C2*y/ln^2 y with C2 ≈ 0.6601618, which gives a co-Sophie Germain count up to x of ~ C2 x/ln^2 x in natural logs. Page 2 sets base 2 'unless stated otherwise', and the conjecture on page 7 states nothing otherwise. Read literally, the printed constant is therefore off by (ln 2)^2. D cancels to leading order in Lemma 5.3, so nothing downstream changes.

Second check: another model agreed

Report a problem with this finding
Wording Lemma 3.3: "Then for n ≥ 1: n/(6 log n) ≤ π(n) ≤ 8n/log n". At n = 1, log n = 0, so both bounds are undefined.
  • p. 3 Lemma 3.3
    Then for n ≥ 1:

Judge's note: Page 3 image confirms 'n ≥ 1'. Since log 1 = 0 in any base, both bounds divide by zero at n = 1. At n = 2 (base-2 log) the bounds give 1/3 ≤ 1 ≤ 16 and hold. The lemma is used only for large arguments in Lemma 4.2, so this is a boundary slip; n ≥ 2 is the evident fix.

Second check: another model agreed

Report a problem with this finding
Wording Primes r with P(r-1)=(r-1)/2 are said to be "called Sophie Germain primes", but Definition 5.2 immediately says that (r-1)/2 is the Sophie Germain prime and r is a "co-Sophie Germain prime".
  • p. 7 Section 5, paragraph before Definition 5.2
    (Such primes are called Sophie Germain primes.)
  • p. 7 Definition 5.2
    We will call such r’s as co-Sophie Germain primes.

Judge's note: On page 7 the antecedent of 'Such primes' is 'many primes r, P(r-1)=(r-1)/2'. Definition 5.2 gives that r the name co-Sophie Germain prime, and the introduction (page 2) defines Sophie Germain primes as p with 2p+1 prime. The two passages apply the term to different objects. The next line resolves it, so this is minor.

Second check: another model agreed

Report a problem with this finding
Wording Conjecture [HL22]: "The number of co-Sophie Germain primes is asymptotic to Dx/log^2 x". The range "less than x" is never stated, so x is free.
  • p. 7 Conjecture [HL22], Section 5
    The number of co-Sophie Germain primes is asymptotic to

Judge's note: On page 7 the conjecture sentence nowhere gives the bound x on the primes being counted. Lemma 5.3 then uses it as a count of primes 'less than c2 log^2 n'. The intended meaning is recoverable, but the statement as printed is incomplete.

Second check: another model agreed

Report a problem with this finding
Wording Lemma 5.3 proof derives the necessary condition "(r-1)/2 >= 4 sqrt r log n => sqrt r >= 8 log n => r >= 64 log^2 n", then counts every co-Sophie Germain prime in [64 log^2 n, c2 log^2 n] as suitable, which needs the converse. The converse fails near 64 log^2 n.
  • p. 7 Proof of Lemma 5.3, displayed chain
    Hence we consider the range 64 log^2 n to c2 log^2 n

Only the authors can say what is right here.

Judge's note: My own working, with L = log n: at r = 64L^2+1, (r-1)/2 = 32L^2, while 4 sqrt(r) L = 4L*sqrt(64L^2+1) > 32L^2. So the step-7 condition q >= 4 sqrt r log n fails just above the lower limit. The exact threshold is sqrt r >= 4L + sqrt(16L^2+1), which is about r >= 64L^2 + 2. The implications as printed are valid, but the proof uses them in reverse. Only O(1) candidates are affected and the slack c2 > 100 vs 64 absorbs them, so the lemma stands (S3).

Second check: another model agreed

Report a problem with this finding
Typo Page 1, Introduction, last paragraph: "all randomzied algorithms" should read "randomized".
  • p. 1 Section 1, last paragraph
    all randomzied algorithms

Judge's note: Checked page 1 image: the misspelling 'randomzied' is in the typeset text.

Second check: none (judge only)

Report a problem with this finding
Typo Page 2, Introduction: "the correctenss proofs" should read "correctness".
  • p. 2 Section 1, first paragraph
    the correctenss proofs

Judge's note: Checked page 2 image: 'correctenss' is printed. The correct spelling 'correctness' appears earlier in the same paragraph.

Second check: none (judge only)

Report a problem with this finding
Typo Page 3, remark after Lemma 3.2: "(see [BH96] for a summary of results of this kind." has no closing parenthesis.
  • p. 3 Remark after Lemma 3.2
    (see [BH96] for a summary of results of this kind.

Judge's note: Page 3 image confirms the ')' is missing before the full stop.

Second check: none (judge only)

Report a problem with this finding
Typo Words run together: "This product has atmost" (p.4), "would take atmost" / "take atmost" (p.7) and "exponents upto 0.6683" (p.3) should read "at most" and "up to".
  • p. 4 Proof of Lemma 4.2
    This product has atmost
  • p. 7 Proof of Theorem 5.1
    would take atmost
  • p. 3 Remark after Lemma 3.2
    exponents upto 0.6683
  • p. 7
    would take atmost r 1 2 poly(log log n) time in the brut

Judge's note: Checked the page 3 and page 4 images and the page 7 crop: 'atmost' and 'upto' are printed. The secondary 'repeated log' note refers to the legitimate 'log log n' and is not a defect.

Second check: code check

Report a problem with this finding
Typo Proof of Lemma 4.2: "(lets call them special primes)" should read "let's".
  • p. 4 Proof of Lemma 4.2
    (lets call them special

Judge's note: Page 4 image confirms 'lets' with no apostrophe.

Second check: none (judge only)

Report a problem with this finding
Something wrong with this page, or a finding we missed?