Refuting two prime-counting conjectures
2026-10-23 [home]
This page contains generated content delineated using this shadowing style.
There exist two conjectures about the number of ways you may write an integer as a sum of prime counts. The first predicts existence and the second conjectures about its uniqueness.
Here, I present two counterexamples: For A262995, we have . For A263100, we have , outside the conjectured list of exceptions.
Both have machine-checked proofs using only
propext, Classical.choice, and Quot.sound.
Here counts the primes less than or equal to . For example, , counting .
Representation doesn't always exist
A262995 counts positive
ordered pairs for which
Here is the th triangular number: .
A conjecture from October 2015 states:
for every .
The entry reports verification through .
This conjecture is false. Take , beyond the reported search range of . The conjecture predicts , but we establish : There is no positive pair representing it.
The argument below certifies this particular counterexample.
Proof
def pairSet (n : ℕ) : Set (ℕ × ℕ) :=
{p | 0 < p.1 ∧ 0 < p.2 ∧
n = Nat.primeCounting (p.1 * (p.1 + 1) / 2) +
Nat.primeCounting (1 + p.2 * (p.2 + 1) / 2)}
noncomputable def a (n : ℕ) : ℕ := (pairSet n).ncard
theorem pairSet_241540 : pairSet 241540 = ∅
theorem a_241540 : a 241540 = 0
Here, p.1 and p.2 are the two coordinates of the
pair. Nat.primeCounting is the aforementioned .
The first theorem states the set of representing pairs
is empty; the second says its cardinality is zero.
First, the proof certifies these two prime counts:
Both are larger than . If , then , so
Such a pair cannot work. The same argument excludes . Every possible representation must therefore satisfy
Now the problem is finite, but there are still two things to establish: The prime counts in the tables are correct, and no two relevant counts sum to the target.
Certifying the prime counts
The source uses a sieve of Eratosthenes. Every composite integer has a prime divisor no larger than its square root, which is why the following finite sieve suffices.
The largest argument needed here is
Thus primes below suffice to sieve the required range. The implementation works in finite windows and proves that a surviving bit corresponds exactly to a prime. Counting those bits gives the number of primes in each interval. Adding the interval counts certifies the tables
The listed table values are not assumptions: The source proves that its table checker returns correct prime counts and then evaluates the checks in Lean's kernel. The tables include indices through , covering every possible solution and the cutoff values used above.
Excluding every sum
Write . For a fixed value , the equation we want to rule out is
If , it is impossible because . Otherwise it is equivalent to
So instead of repeatedly adding every pair of table entries, we can ask whether the complement occurs anywhere in the first table.
The source records that first table as a bitmask: An integer whose bit at position is 1 exactly when occurs as an for a positive table index . For example, a table containing would set bits 0, 2, and 5, giving
Testing bit 2 would report a match; testing bit 3 would not. Repeated table values simply set the same bit again. That is enough here because we are testing existence, not counting how many indices produce each value.
For every positive-index entry in the second
table, the check verifies either or that
bit is unset. Every entry passes: No
complement occurs. The source proves what the
bitmask lookup means and uses decide +kernel
to certify that the finite check returns true.
The bitmask makes the computation efficient; the bounds make it exhaustive. This is not merely a search that failed to find a pair. The bounds exclude every larger pair, and the certified calculation excludes every remaining pair. Thus
I am making no claim that this is the first such zero.
A unique representation in A263100
A263100 counts positive
ordered pairs for which
Its October 2015 conjecture states:
for every , and only for .
The uniqueness clause is false. At , the only representing pair is . This does not disprove positivity: This input has a representation.
Proof
This sequence has its own definitions of pairSet
and a, in a separate Lean namespace:
def pairSet (n : ℕ) : Set (ℕ × ℕ) :=
{p | 0 < p.1 ∧ 0 < p.2 ∧
n = Nat.primeCounting (p.1 ^ 2) +
Nat.primeCounting (p.2 ^ 2 / 2)}
noncomputable def a (n : ℕ) : ℕ := (pairSet n).ncard
theorem mem_pairSet_15293 (k m : ℕ) :
(k, m) ∈ pairSet 15293 ↔ k = 339 ∧ m = 291
theorem a_15293 : a 15293 = 1
Division of natural numbers in Lean rounds down,
so p.2 ^ 2 / 2 is .
The symbol ↔ means “if and only if”: A pair
represents exactly when its coordinates
are and .
First, that pair works:
and .
But finding one pair is not enough to prove uniqueness. We must rule out every other pair. As before, two certified prime counts give bounds:
If or , one summand alone already exceeds the target. Every solution must therefore lie in
The kernel-checked table calculation excludes every except . For that value, the second summand must be . The table then shows that only gives that count.
There is exactly one representing pair, so
Since , part (i) of the stated conjecture is false. This refutes its uniqueness clause, not its positivity clause. The separate conjectures (ii) and (iii) are not addressed here.
Related counterexample
A related entry A263001
counts representations of a different form:
Its conjecture includes the claim that
only for . OEIS also records a counterexample
to this proposed uniqueness list. Like the A263100
example above, it refutes the uniqueness clause,
not positivity.
Source
The source code for both proofs is on my GitHub: A262995Refutation.lean, A263100Refutation.lean.
The former file lives in a Proofs/Sorry directory
in the project; however, its contents machine check
in the manner stated at the top of this post. I will
eventually lift it to the Proofs/ module and update
this post.
AI Disclosure
These results were obtained primarily using a mix of Anthropic, OpenAI, and open weight models in a private benchmark using a bespoke harness.