The Repair of Euler’s Prime Number Formula

THE PRIME NUMBER SERIES 27

Euler’s Prime Number Formula Repaired

 

Euler discovered the remarkable formula

n^2+n+41,

which produces an uninterrupted sequence of prime numbers for all n \in \mathbb{N} with n\ge 0, up to .

From n=40 onward, the formula seemingly produces an arbitrary alternation between composite numbers and prime numbers.

I multiplied the formula n^2+n+41 by an expression that detects composite values and sets them to 0, while allowing only prime numbers to be displayed.

The repaired formula looks like this:

(n^2+n+41)\prod\limits_{k=0} ^\frac{\sqrt{n^2+n+41}-3}{2}  \lceil\sin^2(\frac{n^2+n+41}{2k+3}\pi)\rceil

This formula produces all prime numbers of the original Euler formula. Whether there are infinitely many of the form n^2+n+41 has not yet been proven.

If you want to filter out all prime numbers greater than 2, the formula looks like this:

(2n+3)\prod\limits_{k=0} ^\frac{\sqrt{2n+3}-3}{2}  \lceil\sin^2(\frac{n-k}{2n+3}\pi)\rceil

 

Munich, 3 February 2026

Gottfried Färberböck