# Euler Lucky Number/Examples/41

## Example of Euler Lucky Number

The expression:

$n^2 + n + 41$

yields primes for $n = 0$ to $n = 39$.

It also generates the same set of primes for $n = -1 \to n = -40$.

These are not the only primes generated by this formula.

No other quadratic function of the form $x^2 + a x + b$, where $a, b \in \Z_{>0}$ and $a, b < 10000$ generates a longer sequence of primes.

## Proof

 $\ds 0^2 + 0 + 41$ $=$ $\ds 0 + 0 + 41$ $\ds = 41$ which is prime $\ds 1^2 + 1 + 41$ $=$ $\ds 1 + 1 + 41$ $\ds = 43$ which is prime $\ds 2^2 + 2 + 41$ $=$ $\ds 4 + 2 + 41$ $\ds = 47$ which is prime $\ds 3^2 + 3 + 41$ $=$ $\ds 9 + 3 + 41$ $\ds = 53$ which is prime $\ds 4^2 + 4 + 41$ $=$ $\ds 16 + 4 + 41$ $\ds = 61$ which is prime $\ds 5^2 + 5 + 41$ $=$ $\ds 25 + 5 + 41$ $\ds = 71$ which is prime $\ds 6^2 + 6 + 41$ $=$ $\ds 36 + 6 + 41$ $\ds = 83$ which is prime $\ds 7^2 + 7 + 41$ $=$ $\ds 49 + 7 + 41$ $\ds = 97$ which is prime $\ds 8^2 + 8 + 41$ $=$ $\ds 64 + 8 + 41$ $\ds = 113$ which is prime $\ds 9^2 + 9 + 41$ $=$ $\ds 81 + 9 + 41$ $\ds = 131$ which is prime $\ds 10^2 + 10 + 41$ $=$ $\ds 100 + 10 + 41$ $\ds = 151$ which is prime $\ds 11^2 + 11 + 17$ $=$ $\ds 121 + 11 + 17$ $\ds = 173$ which is prime $\ds 12^2 + 12 + 41$ $=$ $\ds 144 + 12 + 41$ $\ds = 197$ which is prime $\ds 13^2 + 13 + 17$ $=$ $\ds 169 + 13 + 17$ $\ds = 223$ which is prime $\ds 14^2 + 14 + 41$ $=$ $\ds 196 + 14 + 41$ $\ds = 251$ which is prime $\ds 15^2 + 15 + 41$ $=$ $\ds 225 + 15 + 41$ $\ds = 281$ which is prime $\ds 16^2 + 16 + 41$ $=$ $\ds 256 + 16 + 41$ $\ds = 313$ which is prime $\ds 17^2 + 17 + 41$ $=$ $\ds 289 + 17 + 41$ $\ds = 347$ which is prime $\ds 18^2 + 18 + 41$ $=$ $\ds 324 + 18 + 41$ $\ds = 383$ which is prime $\ds 19^2 + 19 + 41$ $=$ $\ds 361 + 19 + 41$ $\ds = 421$ which is prime $\ds 20^2 + 20 + 41$ $=$ $\ds 400 + 20 + 41$ $\ds = 461$ which is prime $\ds 21^2 + 21 + 41$ $=$ $\ds 441 + 21 + 41$ $\ds = 503$ which is prime $\ds 22^2 + 22 + 41$ $=$ $\ds 484 + 22 + 41$ $\ds = 547$ which is prime $\ds 23^2 + 23 + 41$ $=$ $\ds 529 + 23 + 41$ $\ds = 593$ which is prime $\ds 24^2 + 24 + 41$ $=$ $\ds 576 + 24 + 41$ $\ds = 641$ which is prime $\ds 25^2 + 25 + 41$ $=$ $\ds 625 + 25 + 41$ $\ds = 691$ which is prime $\ds 26^2 + 26 + 41$ $=$ $\ds 676 + 26 + 41$ $\ds = 743$ which is prime $\ds 27^2 + 27 + 41$ $=$ $\ds 729 + 27 + 41$ $\ds = 797$ which is prime $\ds 28^2 + 28 + 41$ $=$ $\ds 784 + 28 + 41$ $\ds = 853$ which is prime $\ds 29^2 + 29 + 41$ $=$ $\ds 841 + 29 + 41$ $\ds = 911$ which is prime $\ds 30^2 + 30 + 41$ $=$ $\ds 900 + 30 + 41$ $\ds = 971$ which is prime $\ds 31^2 + 31 + 41$ $=$ $\ds 961 + 31 + 41$ $\ds = 1033$ which is prime $\ds 32^2 + 32 + 41$ $=$ $\ds 1024 + 32 + 41$ $\ds = 1097$ which is prime $\ds 33^2 + 33 + 41$ $=$ $\ds 1089 + 33 + 41$ $\ds = 1163$ which is prime $\ds 34^2 + 34 + 41$ $=$ $\ds 1156 + 34 + 41$ $\ds = 1231$ which is prime $\ds 35^2 + 35 + 41$ $=$ $\ds 1225 + 35 + 41$ $\ds = 1301$ which is prime $\ds 36^2 + 36 + 41$ $=$ $\ds 1296 + 36 + 41$ $\ds = 1373$ which is prime $\ds 37^2 + 37 + 41$ $=$ $\ds 1369 + 37 + 41$ $\ds = 1447$ which is prime $\ds 38^2 + 38 + 41$ $=$ $\ds 1444 + 38 + 41$ $\ds = 1523$ which is prime $\ds 39^2 + 39 + 41$ $=$ $\ds 1521 + 39 + 41$ $\ds = 1601$ which is prime $\ds 40^2 + 40 + 41$ $=$ $\ds 1600 + 40+ 41$ $\ds = 1681$ which is not prime: $1681 = 41^2$

Then we have:

 $\ds \paren {-\paren {n + 1} }^2 + \paren {-\paren {n + 1} }$ $=$ $\ds n^2 + 2 n + 1 - \paren {n + 1}$ $\ds$ $=$ $\ds n^2 + n$

and so replacing $0$ to $39$ with $-1$ to $-40$ yields exactly the same sequence of primes.

We note in addition the example:

$581^2 + 581 + 41 = 338 \, 183$

which is prime.

$\blacksquare$