{"id":"f79a4048-06fb-4812-8d35-b096e4b61d13","arxiv_id":"2509.19324","paper_version":7,"verdict":"CONDITIONAL","confidence":"MODERATE","novelty_score":3.0,"correctness_risk":"low","formal_verification":"none","parameter_count":1,"one_line_summary":"Barrett's 1903 formula exactly counts primes via a Wilson's-theorem sum, and the paper leaves open whether it can recover the prime number theorem.","lead":"A 1903 formula by writer Rafael Barrett counting primes, rediscovered and published in 1935, is described with a new proof. The note asks whether the exact formula can be pushed to yield the prime number theorem's asymptotic law.","discovery_kind":"review","skeptic_critique":{"model":"deepseek-v4-flash","headline":"No significant objection identified","rationale":"The reader's weakest_assumption identifies the same spot in the proof (the composite-case divisibility lemma), so there is partial agreement. However, I do not consider this a load-bearing concern about the central claim: the formula is correct, and the gap is a minor proof-writing issue that is easily repaired. The empirical test would confirm correctness, and the analytic proof of the lemma is straightforward. Since the reader's conditional verdict reflects a caution about the appendix rather than a substantive flaw, I would leave the verdict unchanged.","tokens_in":3129,"tokens_out":5194,"duration_ms":57300,"concrete_test":"Compute Barr(n) for n = 6 to 1000 using the formula and compare the result with pi(n) + 1 (Barrett's convention counts 1 as prime). If any mismatch occurs, the formula is incorrect. Additionally, close the appendix gap by proving k | (k-1)! for composite k >= 5 via the two-case argument: if k = ab with 2 <= a <= b < k, both factors occur in (k-1)!; if k = p^alpha, then v_p((k-1)!) = sum_{j=1}^{alpha} (p^{alpha-j} - 1) = (p^alpha - 1)/(p-1) - alpha, which is >= alpha for all alpha >= 2 with p^alpha >= 5 (equality only for k = 9).","verdict_should_be":"UNCHANGED","load_bearing_attack":"The central claim is that Barr(n) = 3 + sum_{k=5}^{n-1} floor(sin(pi (k-1)!/k) / sin(pi/k)) counts primes p < n (with 1 counted). This is mathematically sound. For prime k >= 5, Wilson's theorem gives (k-1)! = mk - 1 with m odd, so sin(pi(k-1)!/k) = -sin(pi/k), making the floor ratio exactly 1; the constant 3 accounts for 1, 2, and 3. For composite k >= 5, the standard identity k | (k-1)! holds, so the numerator is sin(pi * integer) = 0 and the term vanishes. The reader correctly notes that the appendix's proof of this divisibility is incomplete: for the prime-power case k = p^alpha, the Legendre-sum argument asserts a strict inequality that fails for k = 9 (where the sum equals alpha_i). Equality is sufficient, and the lemma is true, but the proof as written leaves a gap. This is an exposition problem, not a correctness risk: the divisibility fact is elementary and can be supplied independently, and the formula's exactness follows immediately from Wilson's theorem and the sine ratio. No hidden or unstated assumption is load-bearing.","agreement_with_reader":"partial"},"referee_report":{"model":"deepseek-v4-flash","summary":"The paper is a historical and expository note on a 1903 formula by Rafael Barrett, later analyzed by García de Zúñiga in 1935, which counts primes p < n (with 1 counted as prime). The formula is Barr(n) = 3 + sum_{k=5}^{n-1} floor( sin(π(k-1)!/k) / sin(π/k) ). The main claim is that this expression equals the number of primes below n. The paper gives examples, connects the formula to Wilson's theorem, and includes an appendix intended as a proof. The formula itself is correct, but the appendix's proof has a gap in the composite case and a missing parity justification in the prime case.","tokens_in":3455,"tokens_out":7108,"duration_ms":79257,"significance":"If the proof is completed, the paper is a pleasant historical/expository contribution to math.HO. The formula is an elementary curiosity rather than a new mathematical result, and its main interest is historical. The proof strategy is sound in outline and is not circular: it derives the formula from Wilson's theorem and trigonometric identities, with the constant 3 fixed by the primes 1, 2, 3 rather than fitted to data. The paper also honestly poses, without overclaiming, the question of whether an asymptotic limit can be taken. However, the appendix as written does not fully establish the composite-case divisibility on which the exactness of the count rests, so the central claim is not yet fully proven in the manuscript.","major_comments":[{"comment":"The proof that every composite k ≥ 5 divides (k−1)! is incomplete and contains a false statement. The text splits into the cases p_i^{α_i} ≤ k−1 and p_i^{α_i} = k; for the latter it only says 'is shown for k ≥ 8' without giving the argument, and then claims that the Legendre sum (A2) is 'greater than' α_i. For k = 9, v_3(8!) = floor(8/3) + floor(8/9) = 2, which equals α_i, not greater. Equality is sufficient, but a complete proof is needed. For example, one can prove k | (k−1)! for composite k ≥ 5 by splitting k = ab with 1 < a ≤ b < k, and for prime powers p^a use v_p((p^a−1)!) = (p^a−1)/(p−1) − a ≥ a for p^a ≥ 8. This point is load-bearing because the vanishing of the summand for composite k is essential to the prime-counting property.","section":"Appendix, composite case (Eq. A2–A3)"},{"comment":"The proof asserts that the integer m = ((k−1)!+1)/k appearing in (A4)–(A5) is odd ('od an odd integer') but gives no justification. Wilson's theorem alone guarantees only that m is an integer. Oddness follows because (k−1)! is even for k ≥ 3 and k is odd, so m = odd/odd is odd, but this parity argument should be stated. If m were even, sin(mπ − π/k) would equal −sin(π/k) and the floor would be −1, so this is a necessary step in the proof that each prime term contributes exactly 1.","section":"Appendix, prime case (Eq. A4–A5)"}],"minor_comments":[{"comment":"The prime-counting function is typeset as 'n(n)' rather than π(n); please correct.","section":"Eq. (1)"},{"comment":"The paper does not specify for which n the formula is valid. As written, Barr(3)=3 but the primes p<3 counted with 1 are {1,2}; the formula requires n ≥ 4 (or n ≥ 5 if one wants the sum nonempty). Please state the intended domain.","section":"Domain of Barr(n)"},{"comment":"The closing question asks for 'a limit to Barrett's formula that achieves asymptotic formula (1)' but does not define the notion of limit. Clarify whether this means pointwise convergence, asymptotic equivalence after a normalization, or a computational/complexity statement.","section":"Final question"},{"comment":"Reference [5] has several typographical errors: 'Tenembaum' should be 'Tenenbaum', 'nombres premières' should be 'nombres premiers', and 'La Vallée Poissin' should be 'La Vallée Poussin'. Also check the article numbering for reference [3].","section":"References and historical typos"},{"comment":"The displayed version of Eq. (A2) is difficult to read; please ensure the floor notation and summation limits are typeset unambiguously. The derivation of the odd integer in the prime case would also be clearer if written as (k−1)!/k = m − 1/k with m explicitly defined.","section":"Appendix notation"}],"recommendation":"major_revision","confidential_remarks":"This is a historical/expository note whose mathematical content is correct but whose proof, as written, has a technical gap in the appendix. The gap is easily fixable, but it is load-bearing for the exactness claim, so I cannot recommend acceptance without another round. The paper is within scope for a math.HO venue; I would not reject it. The author should also address the small-n domain and the final asymptotic question's vagueness."},"author_rebuttal":null,"desk_editor":{"model":"deepseek-v4-flash","letter":"Colleague, the short version: this is a historical curiosity, not a new mathematical result. The Barrett formula is a correct exact prime counter, and the paper's proof—once you fill in one omitted case—is a standard Wilson's theorem exercise. The final 'challenge' is a vague restatement of the prime number theorem. It deserves a referee for the history and for fixing the exposition, but no one should mistake it for a research contribution.\n\nWhat the paper does well: it tells a genuinely interesting story about Rafael Barrett, a literary figure who sent a prime-counting formula to Poincaré in 1903, and it gives a self-contained proof. The prime case is clean: Wilson gives (k-1)!+1 ≡ 0 mod k, the sine ratio collapses to 1, so each prime contributes exactly 1; the constant 3 covers 1, 2, and 3. The examples check out.\n\nSoft spots: the appendix's composite-case argument has a gap. It uses Legendre's formula to claim that for k = p_i^{alpha_i}, the p_i-adic valuation of (k-1)! is 'greater than' alpha_i. For k=9, the valuation equals 2, not greater. Equality is sufficient, and the lemma k | (k-1)! for composite k is elementary, but the proof asserts the case 'shown for k≥8' without showing it. This is an exposition problem, not a correctness risk; the stress-test note is right that nothing load-bearing hangs on it.\n\nThe 'challenge' at the end is the weakest part. Since Barr(n) equals π(n) (with 1 counted), asking whether it can approach the prime number theorem's asymptotic is just the prime number theorem itself. The question is not false, just empty.\n\nCitations are fine: a handful of historical references, no self-citation, no circularity. Who it's for: someone who enjoys mathematical oddities or the history of amateur prime-formula hunting. A math-history or expository venue would be right. With a small revision—fixing the composite-case proof and either sharpening or dropping the final question—I'd accept it as a legitimate historical note. I'd send it to review, not desk-reject, because the historical claims deserve checking and the proof is close.","headline":"A sound but historically minor note; the formula is correct, the proof has a small correctable gap, and the closing 'challenge' is a restatement of the prime number theorem.","tokens_in":3857,"tokens_out":3395,"would_cite":false,"duration_ms":36387,"reading_group":"maybe","serious_thinker":"yes","would_accept_peer_review":true},"rs_alignment":null,"lean_confirmation":null,"pith_extraction":{"msc":["01A60","11A41","11N05"],"pacs":[],"model":"deepseek-v4-flash","headline":"Rafael Barrett's 1903 trigonometric sum is an exact prime counter.","keywords":["prime number counter","Rafael Barrett formula","Wilson's theorem","trigonometric prime counting","Legendre's formula","prime number theorem","exact prime-counting formula","history of mathematics"],"falsifier":"Compute (k-1)! mod k for every k from 5 to 1000: the formula predicts S(k) = 0 for composites and S(k) = 1 for primes. The first composite with a nonzero residue, or the first prime where Wilson's congruence fails, would make Barr(n) miscount.","tokens_in":3072,"feed_emoji":"🔢","tokens_out":8680,"duration_ms":97294,"temperature":0.7,"pith_summary":"The paper presents a formula that Rafael Barrett sent to Henri Poincaré in 1903, rediscovered by Eduardo García de Zúñiga and published in Montevideo in 1935. The formula counts primes p < n by adding a trigonometric floor term over k = 5, ..., n-1, plus a constant 3 for 1, 2, and 3. The core claim is that each term equals 1 exactly when k is prime and 0 when k is composite, so the sum reproduces the prime count exactly. The proof rests on Wilson's theorem for primes and on divisibility of (k-1)! by k for composites, using Legendre's formula. The paper closes by asking whether this exact expression can be analyzed asymptotically to recover the n/ln n limit of the prime number theorem.","feed_headline":"Barrett's 1903 formula counts primes exactly","feed_subtitle":"An exact trigonometric sum, hidden for decades, turns every integer into a 0-or-1 prime detector.","key_machinery":"The central object is the trigonometric indicator S(k) = floor( sin(pi (k-1)!/k) / sin(pi/k) ). Wilson's theorem is the engine: for prime k, (k-1)! ≡ -1 (mod k), which makes the numerator equal to sin(pi/k) in magnitude and sign, so S(k) = 1; for composite k ≥ 5, divisibility of (k-1)! by k makes the numerator zero, so S(k) = 0. Legendre's formula supplies the factorial-exponent calculation used in the appendix for the composite case. The leading constant 3 accounts for the primes 1, 2, and 3 under Barrett's convention.","core_discovery":"Barrett's formula asserts that Barr(n) = 3 + sum_{k=5}^{n-1} floor( sin(pi (k-1)!/k) / sin(pi/k) ) equals the number of primes p < n, under the historical convention that 1 is counted as prime. The summand is a geometric indicator of primality: for composite k ≥ 5, (k-1)! is divisible by k, so the numerator's sine is zero; for prime k, Wilson's theorem forces the ratio to be 1. Thus every integer k contributes exactly 1 if k is prime and 0 otherwise, making the formula a finite, exact trigonometric expression for the prime-counting function.","pith_inferences":["The same indicator construction could be adapted to count any integer set defined by a factorial divisibility condition, replacing Wilson's theorem with other congruences to generate analogous exact counters.","As a practical counting device the formula is inefficient: forming (k-1)! modulo k up to n costs more work than standard sieves, so its value is conceptual and historical rather than computational.","The paper's closing challenge is essentially the prime number theorem in disguise: showing that the sum of these 0-or-1 indicators is asymptotically n/ln n is equivalent to proving the standard asymptotic distribution of primes."],"forward_implications":["Barrett's formula gives an exact, finite trigonometric expression for the prime-counting function: for any n, one elementary term per integer suffices, with no sieve or search.","The formula converts Wilson's theorem into a quantized counting statement: the congruence (k-1)! ≡ -1 (mod k) becomes a 0-or-1 integer contribution.","Because the sum stops before n, the count is pointwise exact, not merely asymptotic, for every n.","The open problem posed in the paper is whether an asymptotic expansion of this trigonometric sum can reproduce n/ln n, connecting the elementary formula to the prime number theorem's prediction."],"fun_headline_variants":["A 1903 formula hidden for decades counts primes exactly","Exact prime counting: Barrett's lost formula from 1903","Hidden 1903 trig formula is an exact prime counter","1903 prime-count formula rediscovered after decades"],"cache_read_input_tokens":2304,"weakest_assumption_plain":"The formula's exactness assumes that for every composite k ≥ 5, the factorial (k-1)! is divisible by k; the appendix's demonstration of the prime-power subcase is sketched rather than fully shown, and in examples like k = 9 the relevant inequality is an equality, so this divisibility lemma is the part a reader must verify independently.","fun_headline_variants_meta":{"raw":{"variants":["A 1903 formula hidden for decades counts primes exactly","Exact prime counting: Barrett's lost formula from 1903","Hidden 1903 trig formula is an exact prime counter","1903 prime-count formula rediscovered after decades"]},"model":"deepseek-v4-flash","effort":"low","cost_usd":0.000837,"raw_usage":{"total_tokens":3410,"prompt_tokens":588,"completion_tokens":2822,"prompt_tokens_details":{"cached_tokens":256},"prompt_cache_hit_tokens":256,"prompt_cache_miss_tokens":332,"completion_tokens_details":{"reasoning_tokens":2755}},"tokens_in":332,"tokens_out":2822,"duration_ms":21319,"temperature":1.0,"reasoning_tokens":2755,"cache_read_input_tokens":256,"cache_creation_input_tokens":0},"cache_creation_input_tokens":0},"created_at":"2026-08-04T17:35:43.317586+00:00","model_set":{"reader":"deepseek-v4-flash"},"falsifier":"Compute (k-1)! mod k for every k from 5 to 1000: the formula predicts S(k) = 0 for composites and S(k) = 1 for primes. The first composite with a nonzero residue, or the first prime where Wilson's congruence fails, would make Barr(n) miscount.","supporting_citations":[],"review_version":2}