# The conjecture in OEIS A346149 is false: n^k + n + 1 is never prime for one 21-digit n

iis:2611.00357 · by devsingh-lab · https://isitsolved.com/journal/0430c88deae8

**Abstract.** OEIS A346149 (Bergot and Israel, 2021) defines a(n) as the least k > 1 with n^k + n + 1 prime, or 0 if there is none, and conjectures a(n) > 0 unless n > 1 is 1 mod 3. We give a counterexample: for n = 243779134570275685188, which is 0 mod 3, the number n^k + n + 1 is composite for every k > 1. The proof is a covering argument: n^2 + n + 1 handles k = 2 mod 3, and eleven primes with fixed residue classes handle every other k modulo 180. A 95-line Lean 4 proof is checked by the kernel with the standard axioms only. This is a counterexample, not a proved smallest one.

# A counterexample to the conjecture in OEIS A346149

**Theorem 1 (`a346149_counterexample`).** Let $n = 243779134570275685188$. Then $n \not\equiv 1 \pmod 3$ and $n^k + n + 1$ is composite for every integer $k > 1$.

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


[OEIS A346149](https://oeis.org/A346149) (J. M. Bergot and Robert Israel, 2021): a(n) is the least
k > 1 such that n^k + n + 1 is prime, or 0 if there is no such k. For n ≡ 1 (mod 3), n > 1, the
number n^k + n + 1 is always divisible by 3, so a(n) = 0. The entry conjectures that a(n) > 0 for
every other n.

**The conjecture is false.** For

    n = 243779134570275685188        (21 digits, n ≡ 0 mod 3)

the number n^k + n + 1 is composite for every k > 1.

## Why

It is a covering argument: every k > 1 falls in a class where a fixed number divides
n^k + n + 1.

- If k ≡ 2 (mod 3), then n² + n + 1 divides n^k + n + 1, because n³ ≡ 1 modulo n² + n + 1.
  For k > 2 this is a proper divisor. For k = 2 the number n² + n + 1 is divisible by 43.
- Otherwise k lies in one of the eleven classes below. In each, the order of n modulo p divides
  o and p divides n^r + n + 1, so p divides n^k + n + 1 whenever k ≡ r (mod o).

| p | 5 | 7 | 11 | 13 | 19 | 31 | 37 | 331 | 757 | 3511 | 9091 |
|---|---|---|---|---|---|---|---|---|---|---|---|
| k ≡ r | 0 | 1 | 1 | 10 | 0 | 9 | 3 | 0 | 30 | 33 | 42 |
| mod o | 4 | 6 | 5 | 12 | 9 | 15 | 18 | 15 | 36 | 45 | 45 |

These classes contain every residue modulo 180 that is not ≡ 2 (mod 3).

## Lean proof

[`A346149.lean`](https://github.com/DevSingh05/oeis-a346149/blob/main/A346149.lean) is the whole proof, 95 lines:

```lean
theorem a346149_counterexample : (243779134570275685188 : ℕ) % 3 ≠ 1 ∧
    ∀ k : ℕ, 1 < k → ¬ Nat.Prime (243779134570275685188 ^ k + 243779134570275685188 + 1)
```

```
'a346149_counterexample' depends on axioms: [propext, Classical.choice, Quot.sound]
```

No `sorry`, no `native_decide`. Build with `lake exe cache get && lake build` (about a minute
after the Mathlib cache is downloaded).

`scripts/verify.py` checks the same thing with plain integer arithmetic.

## Remarks

- This is a counterexample, not necessarily the smallest one. The smallest cannot be found by
  direct search: an n for which no small exponent k gives a prime simply stays undecided.
- The same method gives other examples, for instance n = 5010689049134674879809162 with fourteen
  primes and period 240 (also checked by the script). Any n in the same residue class modulo the
  product of the primes used, with n ≢ 1 (mod 3) and n² + n + 1 composite, works as well.

## Prior work

On 2026-11-27 I looked for an earlier report and found none in the OEIS entry and its revision
history, on GitHub, or by web search. If one exists, please open an issue and I will credit it.

## Credits

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

