Subscribe now

BrainTwister #36: Prime generators

Can you solve this week’s logic puzzle? Plus our quick quiz and the answer to last week’s problem

By Peter Rowlett

4 September 2024

3D illustration, brain shaped maze. Concept image of study and brain behavior.; Shutterstock ID 2177110871; purchase_order: -; job: -; client: -; other: -

Shutterstock/ktsdesign

#36 Prime generators

set by Peter Rowlett

In 1772, mathematician Leonhard Euler noticed that the value of the polynomial x2 + x + 41 is a prime number if you set x=0. He also spotted it is prime if x=1 and it keeps on giving primes for values of x up to 39.

If we use x2 + x + 3 instead, and put x=0, we get 3. Using x=1 gives 5, but the pattern then breaks because x=2 gives 9, which isn’t prime. So, x2 + x + 3 generates a sequence of two primes.

How many…

Sign up to our weekly newsletter

Receive a weekly dose of discovery in your inbox! We'll also keep you up to date with New Scientist events and special offers.

Sign up

To continue reading, subscribe today with our introductory offers

Unlock this article

No commitment, cancel anytime*

Offer ends 15 January 2025.

*Cancel anytime within 14 days of payment to receive a refund on unserved issues.

Inclusive of applicable taxes (VAT)

or

Existing subscribers

Sign in to your account