Documented by Paolo Borghi — Verified computationally (2026)
The Borghi Polynomial is a quartic integer polynomial that produces a run of
33 consecutive prime values when evaluated at
consecutive integers starting at n = 0. As usual in this context,
primality is tested on the absolute value |f(n)|.
The polynomial
is a monic quartic polynomial, since the leading coefficient (the
coefficient of n⁴) is equal to 1.
This places it within the class of
monic quartic prime-generating polynomials, a mathematically
significant and more restrictive family.
In this stricter category, achieving a long consecutive prime run is notably difficult. The Borghi Polynomial attains a run length of:
L = 33
establishing an exceptionally long documented prime-generating run for a monic quartic polynomial.
Let
f(n) = n⁴ − 25n³ + 154n² + 66n + 43.
Define the run length L as the largest integer such that
|f(n)| is prime for all integers n with
0 ≤ n ≤ L − 1.
For the Borghi Polynomial we have:
L = 33
i.e. |f(n)| is prime for all n = 0, 1, 2, …, 32, and the first
composite value occurs at n = 33.
First composite value:
n = 33 -> f(33) = 457423 = 103 × 4441
The discovery that produced this report used the following domain:
a ∈ [−200, +200], b ∈ [−200, +200], c ∈ [−200, +200], d ∈ primes[2, 200]
The table below lists the 33 consecutive prime values produced by
f(n) = n⁴ − 25n³ + 154n² + 66n + 43 for integers
n = 0, 1, …, 32.
| n | f(n) | is prime |
|---|---|---|
| 0 | 43 | ✔ |
| 1 | 239 | ✔ |
| 2 | 607 | ✔ |
| 3 | 1033 | ✔ |
| 4 | 1427 | ✔ |
| 5 | 1723 | ✔ |
| 6 | 1879 | ✔ |
| 7 | 1877 | ✔ |
| 8 | 1723 | ✔ |
| 9 | 1447 | ✔ |
| 10 | 1103 | ✔ |
| 11 | 769 | ✔ |
| 12 | 547 | ✔ |
| 13 | 563 | ✔ |
| 14 | 967 | ✔ |
| 15 | 1933 | ✔ |
| 16 | 3659 | ✔ |
| 17 | 6367 | ✔ |
| 18 | 10303 | ✔ |
| 19 | 15737 | ✔ |
| 20 | 22963 | ✔ |
| 21 | 32299 | ✔ |
| 22 | 44087 | ✔ |
| 23 | 58693 | ✔ |
| 24 | 76507 | ✔ |
| 25 | 97943 | ✔ |
| 26 | 123439 | ✔ |
| 27 | 153457 | ✔ |
| 28 | 188483 | ✔ |
| 29 | 229027 | ✔ |
| 30 | 275623 | ✔ |
| 31 | 328829 | ✔ |
| 32 | 389227 | ✔ |
The record was established by exhaustive evaluation of f(n) for
consecutive integers and deterministic primality tests up to the first
composite value. For this size range, deterministic methods (including trial
division up to sqrt(x) or deterministic Miller–Rabin for 64-bit integers)
are sufficient.
The computation is lightweight for verifying a single polynomial and can be reproduced on standard hardware in a fraction of a second.
Any reader can verify the run length with the following code:
"""
Deterministic primality test for the monic quartic record:
f(n) = n^4 - 25 n^3 + 154 n^2 + 66 n + 43
"""
A = -25
B = 154
C = 66
D = 43
def is_prime(n: int) -> bool:
if n < 2:
return False
if n % 2 == 0:
return n == 2
d = 3
while d * d <= n:
if n % d == 0:
return False
d += 2
return True
def f(n: int) -> int:
return n**4 + A*n**3 + B*n**2 + C*n + D
def main():
primes = []
n = 0
while True:
v = f(n)
if v < 2 or not is_prime(abs(v)):
break
primes.append((n, v))
n += 1
L = len(primes)
print("Record quartic:")
print(f" (a, b, c, d) = ({A}, {B}, {C}, {D})")
print("\nLength of the consecutive prime run (L):", L)
print(f"First composite at n = {L}: f(n) = {f(L)}")
if __name__ == "__main__":
main()
Running this program will output Run length L = 33, confirming
the claimed record.
Suggested citation (APA-style):
Borghi, P. (2026). A Prime-Generating Monic Quartic Polynomial
with Run Length L = 33. Zenodo. (DOI pending)
Paolo Borghi
Independent researcher in number theory and prime-generating polynomials.
paolo.borghi@gmail.com