# Sun's conjecture in OEIS A234388: part (ii) is false, first at n = 9144

iis:2611.00359 · by devsingh-lab · https://isitsolved.com/journal/91af13d9956d

**Abstract.** OEIS A234388 (Zhi-Wei Sun, 2013) conjectures that (i) every n > 1 is k + m with k, m > 0 and 2^k (2^phi(m) - 1) + 1 prime, and (ii) every n > 2 is k + m with 2^k (2^phi(m) - 1) - 1 prime. Part (i) fails at n = 5962, found by Jason Yuen in 2024. We show part (ii) is false too: it fails at n = 9144, and this is the least counterexample. Both failures are proved in Lean 4, checked by the kernel with the standard axioms only: each of the 9143 (and 5961) values gets a prime factor below 10^8 or a failed base-2 Fermat test. Minimality is by computation, with a primality proof for one value at every smaller n.

# Sun's conjecture in OEIS A234388: part (ii) is false, and part (i) in Lean

**Theorem 1 (`OeisA234388.conjecture_ii_false`).** It is not true that every $n > 2$ can be written as $k + m$ with $k, m > 0$ and $2^k(2^{\varphi(m)} - 1) - 1$ prime: there is no such pair for $n = 9144$.

**Theorem 2 (`OeisA234388.conjecture_i_false`, counterexample due to Jason Yuen).** The same with $+1$ in place of $-1$ fails for $n = 5962$.

Lean receipt requested on this site: https://isitsolved.com/lean/receipts/a48cdd453fd9


[OEIS A234388](https://oeis.org/A234388) (Zhi-Wei Sun, December 2013) conjectures, with φ Euler's
totient function:

| | Assertion | Status |
|---|---|---|
| (i) | every integer n > 1 can be written as k + m with k, m > 0 such that 2^k (2^φ(m) − 1) + 1 is prime | False at n = 5962. Found by Jason Yuen in 2024 ([OEIS A234399](https://oeis.org/A234399)). Formalised here, not new. |
| (ii) | every integer n > 2 can be written as k + m with k, m > 0 such that 2^k (2^φ(m) − 1) − 1 is prime | **False. It fails at n = 9144, the smallest counterexample.** New here. |

| Claim | How it is established |
|---|---|
| Both 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`. |
| 9144 (and 5962) are the smallest counterexamples | Computation: every smaller n has a k whose value is **proved** prime (not a probable-prime test). Not a Lean proof. |

## Reading the proof

Three files are written by hand. Start with them:

| File | Lines | What it is |
|---|---|---|
| [`OeisA234388/Main.lean`](https://github.com/DevSingh05/oeis-a234388/blob/main/OeisA234388/Main.lean) | 44 | The two theorems |
| [`OeisA234388/Checker.lean`](https://github.com/DevSingh05/oeis-a234388/blob/main/OeisA234388/Checker.lean) | 177 | A compositeness checker that the Lean kernel can run, with its soundness proofs |
| [`OeisA234388/Sanity.lean`](https://github.com/DevSingh05/oeis-a234388/blob/main/OeisA234388/Sanity.lean) | 23 | Checks that the checker refuses primes |

Everything in [`OeisA234388/Generated/`](https://github.com/DevSingh05/oeis-a234388/blob/main/OeisA234388/Generated) is produced by
`scripts/gen_lean.py`: the certificates, and the checker applied to them.

```lean
theorem conjecture_i_false :
    ¬ ∀ n : ℕ, 1 < n →
      ∃ k m : ℕ, 0 < k ∧ 0 < m ∧ k + m = n ∧ Nat.Prime (2 ^ k * (2 ^ m.totient - 1) + 1)
theorem conjecture_ii_false :
    ¬ ∀ n : ℕ, 2 < n →
      ∃ k m : ℕ, 0 < k ∧ 0 < m ∧ k + m = n ∧ Nat.Prime (2 ^ k * (2 ^ m.totient - 1) - 1)
```

```
'OeisA234388.conjecture_i_false' depends on axioms: [propext, Classical.choice, Quot.sound]
'OeisA234388.conjecture_ii_false' depends on axioms: [propext, Classical.choice, Quot.sound]
```

### How the proofs work

For n = 9144 each of the 9143 values 2^k (2^φ(n−k) − 1) − 1 must be composite (5961 values for
n = 5962). They have up to about 9,100 bits. Each k gets a certificate:

- **A prime factor** below 10⁸, for 86% of the k. The kernel checks one division.
- **A failed Fermat test**, `2 ^ (N − 1) % N ≠ 1`, for the other 1307 (838 for n = 5962). This is
  sound by Fermat's little theorem (from Mathlib) and needs a modular exponentiation `powMod`,
  written so that the kernel can evaluate it and proved equal to `b ^ e % m`.

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

The checker is the one from [oeis-a234360](https://github.com/DevSingh05/oeis-a234360), where
the same method settles three assertions of a neighbouring conjecture of Sun.

### Build

    lake exe cache get
    lake build

About 30 minutes on a laptop (2 CPU-hours), a few GB of RAM. To regenerate from scratch:

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

## The counterexamples are the smallest

For every n below each counterexample, [`data/witnesses_*.txt`](https://github.com/DevSingh05/oeis-a234388/blob/main/data) lists a k for which the
expression is prime, and [`data/proofs_*.txt`](https://github.com/DevSingh05/oeis-a234388/blob/main/data) records how each prime was proved:

| Method | (i), n < 5962 | (ii), n < 9144 |
|---|---|---|
| Below 3.3·10²⁴: Miller–Rabin with the first 12 prime bases, a proof in that range | 145 | 133 |
| Proth's theorem (N − 1 = 2^k·h with h < 2^k) | 5435 | |
| The N + 1 test with a Lucas sequence (N + 1 = 2^k·h with h < 2^k) | | 8484 |
| PARI/GP `isprime` (APRCL or ECPP, a proof), up to 6365 bits | 380 | 524 |

`scripts/minimality.py` finds the witnesses and `scripts/prove_witnesses.py` proves them.

## Independent check

`scripts/verify_independent.py` is a separate program (own totient code, explicit small factor
or a Fermat test to base 3 instead of base 2) that certifies every k for both n. As a control it
finds prime witnesses at n = 9143.

## Prior work

Part (i): Jason Yuen, comment in OEIS A234399, 4 November 2024.

Part (ii): on 2026-11-26 I looked for an earlier report and found none in the OEIS entries
A234388 and A234399 and their revision histories, in Sun's papers arXiv:1211.1588 and
arXiv:1402.6641 (the conjecture is not in either), on GitHub, or by web search. If an earlier
report exists, please open an issue and I will credit it here.

## Credits

Part (ii) was found on 2026-11-26 by Dev Pratap Singh, in a search of Sun's December 2013 family
of conjectures. The search, certificates and Lean proofs were produced with AI assistance
(Claude, Anthropic). MIT license.

