Prime-generating polynomial · Official record

Polynomial (L = 33)

A Prime-Generating Monic Quartic Polynomial

Documented by Paolo Borghi — Verified computationally (2026)

The polynomial

f(n) = n⁴ − 25n³ + 154n² + 66n + 43

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)|.

Category: monic quartic prime-generating polynomial

The polynomial

f(n) = n⁴ − 25n³ + 154n² + 66n + 43

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.

Formal statement of the record

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]

Prime values for 0 ≤ n ≤ 32

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
043
1239
2607
31033
41427
51723
61879
71877
81723
91447
101103
11769
12547
13563
14967
151933
163659
176367
1810303
1915737
2022963
2132299
2244087
2358693
2476507
2597943
26123439
27153457
28188483
29229027
30275623
31328829
32389227

Computational verification (sketch)

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.

Reproducibility: minimal Python snippet

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.

Record summary

  • Name Borghi Polynomial
  • Degree 4 (quartic)
  • Form f(n) = n⁴ − 25n³ + 154n² + 66n + 43
  • Coefficients a = −25, b = 154, c = 66, d = 43
  • Run length L = 33
  • Domain consecutive n ≥ 0
  • Primality tested on |f(n)|

Official reference

Zenodo record
P. Borghi, "A Prime-Generating Monic Quartic Polynomial with Run Length L = 33", Zenodo, 2026.
Record: DOI

How to cite

Suggested citation (APA-style):

Borghi, P. (2026). A Prime-Generating Monic Quartic Polynomial 
with Run Length L = 33. Zenodo. (DOI pending)

Author

Paolo Borghi
Independent researcher in number theory and prime-generating polynomials.
paolo.borghi@gmail.com