The polynomial

f(n) = n⁴ − 41n³ + 550n² − 2622n + 4099

This monic quartic integer polynomial produces a run of 37 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)|.

Run length: L = 37

Category: monic quartic prime-generating polynomial

The polynomial

f(n) = n⁴ − 41n³ + 550n² − 2622n + 4099

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 than generic quartic polynomials.

In this stricter category, achieving a long consecutive prime run is notably difficult. The polynomial above attains a run length of:

L = 37

establishing an exceptionally long documented prime-generating run for a monic quartic polynomial.

From L = 33 to L = 37 via translation

The starting polynomial (L = 33)

The genealogy starts from the quartic

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

which generates L = 33 consecutive primes starting at n = 0. Explicitly, |g(n)| is prime for n = 0, 1, …, 32, and the first composite value occurs at n = 33:

g(33) = 457423 = 103 × 4441.

The n → n − 1 translation method

Given a polynomial P(n) with a long prime run, one can construct a translated polynomial

Q(n) = P(n − 1).

If the newly introduced value P(−1) is also prime, then the prime run of Q(n) starting at n = 0 is extended by one:

  • P(n) is prime for n = 0, …, L − 1,
  • P(L) is composite,
  • P(−1) is prime,

which implies that Q(n) = P(n − 1) is prime for n = 0, …, L, with the first composite at n = L + 1. Iterating this translation constructs a genealogical tree of quartic polynomials, each step corresponding to a shift by n → n − 1.

Structural nature of the record

Applying this method repeatedly to the starting polynomial with L = 33 yields the structural record

f(n) = n⁴ − 41n³ + 550n² − 2622n + 4099

with run length L = 37. The process cannot be extended further within this genealogy, as the next value on the negative side is composite (g(−5) = 7313 = 71 × 103), preventing another successful translation step that would increase L.

The genealogical tree (L = 37 → L = 1)

Starting from the structural record with L = 37, we obtain a full genealogical family of monic quartic polynomials by iterated translations. Each polynomial fL(n) has the form

fL(n) = n⁴ + a n³ + b n² + c n + d

and generates exactly L consecutive primes for n = 0, …, L − 1. For every entry in this family, the first composite appears at n = L and takes the same value:

fL(L) = 457423 = 103 × 4441.

The complete genealogical table is:

L Quartic polynomial fL(n)
37n⁴ − 41n³ + 550n² − 2622n + 4099
36n⁴ − 37n³ + 433n² − 1641n + 1987
35n⁴ − 33n³ + 328n² − 882n + 743
34n⁴ − 29n³ + 235n² − 321n + 157
33n⁴ − 25n³ + 154n² + 66n + 43
32n⁴ − 21n³ + 85n² + 303n + 239
31n⁴ − 17n³ + 28n² + 414n + 607
30n⁴ − 13n³ − 17n² + 423n + 1033
29n⁴ − 9n³ − 50n² + 354n + 1427
28n⁴ − 5n³ − 71n² + 231n + 1723
27n⁴ − n³ − 80n² + 78n + 1879
26n⁴ + 3n³ − 77n² − 81n + 1877
25n⁴ + 7n³ − 62n² − 222n + 1723
24n⁴ + 11n³ − 35n² − 321n + 1447
23n⁴ + 15n³ + 4n² − 354n + 1103
22n⁴ + 19n³ + 55n² − 297n + 769
21n⁴ + 23n³ + 118n² − 126n + 547
20n⁴ + 27n³ + 193n² + 183n + 563
19n⁴ + 31n³ + 280n² + 654n + 967
18n⁴ + 35n³ + 379n² + 1311n + 1933
17n⁴ + 39n³ + 490n² + 2178n + 3659
16n⁴ + 43n³ + 613n² + 3279n + 6367
15n⁴ + 47n³ + 748n² + 4638n + 10303
14n⁴ + 51n³ + 895n² + 6279n + 15737
13n⁴ + 55n³ + 1054n² + 8226n + 22963
12n⁴ + 59n³ + 1225n² + 10503n + 32299
11n⁴ + 63n³ + 1408n² + 13134n + 44087
10n⁴ + 67n³ + 1603n² + 16143n + 58693
9n⁴ + 71n³ + 1810n² + 19554n + 76507
8n⁴ + 75n³ + 2029n² + 23391n + 97943
7n⁴ + 79n³ + 2260n² + 27678n + 123439
6n⁴ + 83n³ + 2503n² + 32439n + 153457
5n⁴ + 87n³ + 2758n² + 37698n + 188483
4n⁴ + 91n³ + 3025n² + 43479n + 229027
3n⁴ + 95n³ + 3304n² + 49806n + 275623
2n⁴ + 99n³ + 3595n² + 56703n + 328829
1n⁴ + 103n³ + 3898n² + 64194n + 389227

Computational verification (sketch)

The structural record and all polynomials in the genealogical tree were verified by exhaustive evaluation and deterministic primality checks on 64-bit integers.

For the record polynomial

f(n) = n⁴ − 41n³ + 550n² − 2622n + 4099

we have:

  • |f(n)| is prime for n = 0, 1, …, 36,
  • the first composite appears at n = 37,
  • f(37) = 457423 = 103 × 4441.

Minimal Python snippet

The following code reproduces the run length L = 37 for the structural record:

"""
Deterministic primality test for the structural monic quartic record:

    f(n) = n^4 - 41 n^3 + 550 n^2 - 2622 n + 4099
"""

A = -41
B = 550
C = -2622
D = 4099

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("Structural quartic record:")
    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()