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 a(241540)=0. For A263100, we have a(15293)=1, outside the conjectured list of exceptions.

Both have machine-checked proofs using only propext, Classical.choice, and Quot.sound.

Here π(x) counts the primes less than or equal to x. For example, π(10)=4, counting 2,3,5,7.

Representation doesn't always exist

A262995 counts positive ordered pairs (k,m) for which

n=π(Tk)+π(1+Tm), Tj=j(j+1)2.

Here Tj=1+2+⋯+j is the jth triangular number: 1,3,6,10,….

A conjecture from October 2015 states:

a(n)>0 for every n>0.

The entry reports verification through 105=100000.

This conjecture is false. Take n=241540, beyond the reported search range of 100000. The conjecture predicts a(241540)>0, but we establish a(241540)=0: There is no positive pair (k,m) 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:

π(T2596)=241602, π(1+T2596)=241603.

Both are larger than 241540. If k≥2596, then Tk≥T2596, so

π(Tk)+π(1+Tm)≥π(Tk)≥241602>241540.

Such a pair cannot work. The same argument excludes m≥2596. Every possible representation must therefore satisfy

1≤k≤2595, 1≤m≤2595.

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

1+T2596=3370907<18372.

Thus primes below 1837 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

Ak=π(Tk), Bm=π(1+Tm).

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 2596, covering every possible solution and the cutoff values used above.

Excluding every sum

Write N=241540. For a fixed value b=Bm, the equation we want to rule out is

Ak+b=N.

If b>N, it is impossible because Ak≥0. Otherwise it is equivalent to

Ak=N-b.

So instead of repeatedly adding every pair of table entries, we can ask whether the complement N-b occurs anywhere in the first table.

The source records that first table as a bitmask: An integer whose bit at position r is 1 exactly when r occurs as an Ak for a positive table index k. For example, a table containing {0,2,5} would set bits 0, 2, and 5, giving

20+22+25=37.

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 b in the second table, the check verifies either b>N or that bit N-b 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

a(241540)=0.

I am making no claim that this is the first such zero.

A unique representation in A263100

A263100 counts positive ordered pairs (k,m) for which

n=π(k2)+π(⌊m2/2⌋).

Its October 2015 conjecture states:

a(n)>0 for every n>0, and a(n)=1 only for n=1,3,28.

The uniqueness clause is false. At n=15293, the only representing pair is (339,291). 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 ⌊m2/2⌋. The symbol ↔ means “if and only if”: A pair represents 15293 exactly when its coordinates are 339 and 291.

First, that pair works:

π(3392)=π(114921)=10867, π(⌊2912/2⌋)=π(42340)=4426,

and 10867+4426=15293.

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:

π(4102)=15346>15293, π(⌊5792/2⌋)=15308>15293.

If k≥410 or m≥579, one summand alone already exceeds the target. Every solution must therefore lie in

1≤k≤409, 1≤m≤578.

The kernel-checked table calculation excludes every k except 339. For that value, the second summand must be 15293-10867=4426. The table then shows that only m=291 gives that count.

There is exactly one representing pair, so

a(15293)=1.

Since 15293∉{1,3,28}, 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:

n=π(k(k+1))+π(m(m+1)2), k,m>0.

Its conjecture includes the claim that a(n)=1 only for n=1,4,6. 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.