# Three of the four assertions of Sun's Conjecture 3.28 (OEIS A234360) are false

iis:2611.00360 · by devsingh-lab · https://isitsolved.com/journal/81678b6ece51

**Abstract.** Conjecture 3.28 of Zhi-Wei Sun's 'Conjectures on representations involving primes' (arXiv:1211.1588; OEIS A234360) makes four assertions that a prime of a given form exists for every n. One was disproved at n = 1408 by Adamczewski (arXiv:2608.11941). We show the other three are false, with least counterexamples n = 4722 for (k+1)^phi(n-k) + k, n = 7588 for k(k+1)^phi(n-k) + 1, and n = 3998 for k(k+1)^(phi(n-k)/2) - 1. In formal-conjectures these are OEIS/234360 conjecture_1, conjecture_3 and conjecture_4. The negation of each is proved in Lean 4 and checked by the kernel with the standard axioms only: every k gets a prime factor below 10^9 or a failed base-2 Fermat test, on numbers of up to 66,000 bits. Minimality is by computation, with a primality proof for one value at every smaller n.

# Three of the four assertions in Sun's Conjecture 3.28 (OEIS A234360) are false

**Theorem 1 (`OeisA234360.conjecture_1_false`).** For $n = 4722$, $(k+1)^{\varphi(n-k)} + k$ is composite for every $0 < k < n$.

**Theorem 2 (`OeisA234360.conjecture_3_false`).** For $n = 7588$, $k(k+1)^{\varphi(n-k)} + 1$ is composite for every $0 < k < n$.

**Theorem 3 (`OeisA234360.conjecture_4_false`).** For $n = 3998$ there are no $0 < k < n$ and prime $p$ with $(p+1)^2 = k^2 (k+1)^{\varphi(n-k)}$.

Atlas ids: OEIS/234360#OeisA234360.conjecture_1, conjecture_3, conjecture_4. Lean receipt scheduled on this site: https://isitsolved.com/lean/receipts/d0d38bb1bf4c


Zhi-Wei Sun, *Conjectures on representations involving primes*
([arXiv:1211.1588](https://arxiv.org/abs/1211.1588), Conjecture 3.28, dated 2012-12-24; also the
conjecture in [OEIS A234360](https://oeis.org/A234360)) makes four assertions. With φ Euler's
totient function:

| | Assertion | Status |
|---|---|---|
| (i) a | for every n > 1, (k+1)^φ(n−k) + k is prime for some 0 < k < n | **False. It fails at n = 4722, the smallest counterexample.** |
| (i) b | for every n > 5, (k+1)^(φ(n−k)/2) − k is prime for some 0 < k < n | False at n = 1408 (T. Adamczewski, OEIS Open, [arXiv:2608.11941](https://arxiv.org/abs/2608.11941)). Not this repo. |
| (ii) a | for every n > 1, k(k+1)^φ(n−k) + 1 is prime for some 0 < k < n | **False. It fails at n = 7588, the smallest counterexample.** |
| (ii) b | for every n > 3, k(k+1)^(φ(n−k)/2) − 1 is prime for some 0 < k < n | **False. It fails at n = 3998, the smallest counterexample.** |

(The labels follow the OEIS entry; the paper groups the same four assertions differently.)

| Claim | How it is established |
|---|---|
| The three assertions are false | Lean 4 proofs checked by the Lean kernel. `#print axioms` gives `propext`, `Classical.choice`, `Quot.sound` and nothing else: no `sorry`, no `native_decide`. |
| 4722, 7588 and 3998 are the smallest counterexamples | Computation: every smaller n has a witness k whose value is **proved** prime (not a probable-prime test). Not a Lean proof. |

In [google-deepmind/formal-conjectures](https://github.com/google-deepmind/formal-conjectures)
the three statements are `OeisA234360.conjecture_1`, `conjecture_3` and `conjecture_4`, tagged
`research open` at commit `9097e2f`. Sun's b-file covers n ≤ 2500, where all four assertions hold.

## Reading the proof

Three files are written by hand. Start with them:

| File | Lines | What it is |
|---|---|---|
| [`OeisA234360/Main.lean`](https://github.com/DevSingh05/oeis-a234360/blob/main/OeisA234360/Main.lean) | 57 | The three theorems, stated as the negations of the formal-conjectures statements |
| [`OeisA234360/Checker.lean`](https://github.com/DevSingh05/oeis-a234360/blob/main/OeisA234360/Checker.lean) | 207 | A compositeness checker that the Lean kernel can run, with its soundness proofs |
| [`OeisA234360/Sanity.lean`](https://github.com/DevSingh05/oeis-a234360/blob/main/OeisA234360/Sanity.lean) | 26 | Checks that the checker refuses primes |

Everything in [`OeisA234360/Generated/`](https://github.com/DevSingh05/oeis-a234360/blob/main/OeisA234360/Generated) is produced by
`scripts/gen_lean.py`. It contains the certificates and applies the checker to them; there is
nothing to read there.

```lean
theorem conjecture_1_false : ¬ ∀ n : ℕ, 1 < n → 0 < a n
theorem conjecture_3_false :
    ¬ ∀ n : ℕ, 1 < n → ∃ k, 0 < k ∧ k < n ∧ Nat.Prime (k * (k + 1) ^ (n - k).totient + 1)
theorem conjecture_4_false :
    ¬ ∀ n : ℕ, 3 < n → ∃ k, 0 < k ∧ k < n ∧
      ∃ p : ℕ, p.Prime ∧ (p + 1) ^ 2 = k ^ 2 * (k + 1) ^ (n - k).totient
```

```
'OeisA234360.conjecture_1_false' depends on axioms: [propext, Classical.choice, Quot.sound]
'OeisA234360.conjecture_3_false' depends on axioms: [propext, Classical.choice, Quot.sound]
'OeisA234360.conjecture_4_false' depends on axioms: [propext, Classical.choice, Quot.sound]
```

Here `a` is imported unchanged from formal-conjectures.

### How the proofs work

Each counterexample needs every value of k shown composite: 4721, 7587 and 3997 numbers, the
largest of about 38,000, 66,000 and 16,000 bits. Each k gets a certificate:

- **A prime factor** below 10⁹, for 87% of the k. The kernel checks one division.
- **A failed Fermat test**, `2 ^ (N − 1) % N ≠ 1`, for the other 725, 1134 and 287. This is sound
  by Fermat's little theorem (from Mathlib) and needs a modular exponentiation `powMod`, written
  so that the kernel can evaluate it on numbers of this size and proved equal to `b ^ e % m`.
- For (ii) b the statement is `(p+1)² = k²(k+1)^φ`. For even φ this forces
  `p = k(k+1)^(φ/2) − 1`, which gets one of the certificates above. For odd φ (k = n − 2 and
  n − 1) the right-hand side lies strictly between two consecutive squares.

Euler's totient is read from a table for m < 7588, which `Generated/PhiSpec.lean` proves equal
to `Nat.totient`. Every check is closed by `decide +kernel`.

### Why the generated part is split into "lanes"

It cannot be one file. The kernel needs about 20 seconds and 6 GB for a Fermat test on a
66,000-bit number, and there are 2146 Fermat tests. So the range of k is cut into segments of
bounded cost, and the segments are placed in `Lane*.lean` files that import each other in
chains: Lake compiles the large ones one after another and the small ones in parallel.
`scripts/gen_lean.py` documents the layout.

### Build

    lake exe cache get
    lake build

This took 61 minutes of wall time (2.6 CPU-hours) on an 18-core Apple-silicon laptop with 24 GB
of RAM, and needs about 16 GB free. The last lines of the build are the `#print axioms` output
above.

To regenerate everything from scratch:

    python scripts/find_certificates.py   # trial division to 10^9, about 3 minutes
    python scripts/gen_lean.py            # writes OeisA234360/Generated

## The counterexamples are the smallest

For every n below each counterexample (4720, 7586 and 3994 values of n),
[`data/witnesses_c*.txt`](https://github.com/DevSingh05/oeis-a234360/blob/main/data) lists a k for which the expression is prime, and each of those
primes has a primality proof:

| Method | (i) a | (ii) a | (ii) b |
|---|---|---|---|
| Below 3.3·10²⁴: Miller–Rabin with the first 12 prime bases, which is a proof in that range (Sorenson–Webster) | 4250 | 5605 | 3684 |
| N − 1 fully factored, since N − 1 = k(k+1)^φ: Pocklington's theorem | | 1981 | |
| PARI/GP `isprime` (APRCL or ECPP, a proof), up to 7060 bits | 470 | | 310 |

`scripts/minimality.py` finds the witnesses and `scripts/prove_witnesses.py` proves the large
ones. Together they take a few minutes on a laptop.

## Independent checks of the counterexamples

- `scripts/verify_independent.py`: a separate Python program, with its own totient code, that
  certifies every k for all three n (trial division by modular exponentiation, Fermat base 2).
- The search that found them used different code again, with Fermat base 3.

Nothing the scripts write is trusted: a wrong certificate or a gap in the cover makes the Lean
build fail.

## Prior work

On 2026-11-26 I looked for earlier reports of these three counterexamples and found none in:
the OEIS entry and its revision history; Sun's paper (v29, Remark 3.28); formal-conjectures pull
requests and issues; the OEIS Open paper and results repository, which settle (i) b only; GitHub
code search; lefttosolve.com, which lists all three as open; and web search. If an earlier report
exists, please open an issue and I will credit it here.

## Credits

Found on 2026-11-26 by Dev Pratap Singh in a computational screen of the open OEIS conjectures in
formal-conjectures. The search, certificates and Lean proofs were produced with AI assistance
(Claude, Anthropic). MIT license.

