Hostname: page-component-7479d7b7d-pfhbr Total loading time: 0 Render date: 2024-07-16T00:20:57.590Z Has data issue: false hasContentIssue false

Euler’s prime-producing polynomial revisited

Published online by Cambridge University Press:  15 February 2024

Robert Heffernan
Department of Mathematics, Munster Technological University, Cork, Ireland e-mail:
Nick Lord
Tonbridge School, Kent TN9 1JP e-mail:
Des MacHale
School of Mathematics, Applied Mathematics and Statistics, University College Cork, Cork, Ireland e-mail: d.machale@ucc.ief
Rights & Permissions [Opens in a new window]


Core share and HTML view are not available for this content. However, as you have access to this content, a full PDF is available via the ‘Save PDF’ action button.

Euler’s polynomial f (n) = n2 + n + 41 is famous for producing 40 different prime numbers when the consecutive values 0, 1, …, 39 are substituted: see Table 1. Some authors, including Euler, prefer the polynomial f (n − 1) = n2n + 41 with prime values for n = 1, …, 40. Since f (−n) = f (n − 1), f (n) actually takes prime values (with each value repeated once) for n = −40, −39, …, 39; equivalently the polynomial f (n − 40) = n2 − 79n + 1601 takes (repeated) prime values for n = 0, 1, …, 79.

Creative Commons
Creative Common License - CCCreative Common License - BYCreative Common License - NCCreative Common License - SA
This is an Open Access article, distributed under the terms of the Creative Commons Attribution-NonCommercial-ShareAlike licence (, which permits non-commercial re-use, distribution, and reproduction in any medium, provided the same Creative Commons licence is included and the original work is properly cited. The written permission of Cambridge University Press must be obtained for commercial re-use.
© The Authors, 2024 Published by Cambridge University Press on behalf of The Mathematical Association


Euler, L., Extrait d’une lettre de M. Euler le pere à M. Bernoulli concernant le Mémoire imprimé parmi ceux de 1771 (1774) E461. English translation by Todd Doucet available at Google Scholar
Lord, N., Prime values of polynomials, Math. Gaz. 79 (November 1995) pp. 572-573.CrossRefGoogle Scholar
SageMath, The Sage Mathematics Software System, Version 9.6 Google Scholar
Wikipedia article, Ulam spiral, accessed May 2023 at Google Scholar
Euler, L., Introductio in analysin infinitorum, vol 1 (1748) E101, chapter 9, accessed at Google Scholar
Cohn, H., Advanced number theory, Dover (1980) pp. 155158.Google Scholar
Wolfram mathworld, Prime-generating polynomials, accessed May 2023 at Google Scholar