## You're reading: Posts Tagged: euler

### Prime-generating functions

A few weeks ago I heard someone casually refer to ‘that formula of Euler’s that generates primes’. I hadn’t heard of this, but it turns out that in 1772 Euler produced this formula:

$f(x) = x^2 + x + 41\text{.}$

Using this, $$f(0)=41$$, which is prime. $$f(1)=43$$, which is also prime. $$f(2)=47$$ is another prime. In fact this sequence of primes continues for an incredible forty integer inputs until $$f(40)=41^2$$. It might generate more primes for higher inputs, but what’s interesting here is the uninterrupted sequence of forty primes.

This got me wondering. Clearly $$f(0)$$ is prime because 41 is prime, so that much will work for any function

$f(x) = x^2 + x + p$

for prime $$p$$, since $$f(0)=0^2+0+p=p$$. Are there other values of $$p$$ that generate a sequence of primes? Are there any values of $$p$$ that generate longer sequences of primes?

I wrote some code to investigate this. Lately, I’ve taken to writing C++ when I need a bit of code, for practice, so I wrote this in C++.

I figured the cases where $$f(0)$$ is prime but $$f(1)$$ isn’t weren’t that interesting, since $$f(0)$$ is trivially prime. In fact, $$f(x)=x g(x)+p=p$$ when $$x=0$$ for any prime $$p$$, but saying so doesn’t seem worth the effort.

So I kept track of the primes $$p$$ whose functions $$f(x)=x^2+x+p$$ generate more than one prime, and the lengths of the sequences of primes generated by each of these. This produced a pair of integer sequences.

I put the primes that work into the OEIS and saw that I had generated a list of the smaller twin in each pair of twin primes. I was momentarily spooked by this, until I realised it was obvious. Since $$f(0)=p$$ and $$f(1)=1^2+1+p=p+2$$, any prime this works for will generate at least a twin prime pair $$p,p+2$$.

What about the lengths of the sequences of consecutive primes generated? The table below shows the sequences of consecutive primes generated for small values of $$p$$. Most primes that generate a sequence produce just two, and $$p=41$$ definitely stands out by generating forty.

I was pleased to see this sequence of lengths of primes generated was not in the OEIS. So I submitted it, and it is now, along with the code I wrote. (I discovered along the way that the version where sequences of length one are included was already in the database.)

Anyway, I amused myself by having some C++ code published, and by citing Euler in a mathematical work. Enjoy: A371896.

### Euler in maths and engineering

Inspired by Katherine Johnson’s character in the film Hidden Figures and her use of Euler’s Method, engineer Natalie-Claire Luwisha has written this guest post about Euler’s contribution to engineering.

I thoroughly enjoyed Hidden Figures because of the overall message and inspiration it generated for all women, especially women of colour. Even today in the 21st century, most of the STEM (science, technology, engineering and mathematics) industries still have a very low percentage of women and even fewer women of colour. One major factor in this is the lack of visible role models for young girls and women to aspire to, so this story based on real-life events was ideal to help tackle the issue.

### Mathematical myths, legends and inaccuracies: some examples

I’m teaching a first-year module on the history of mathematics for undergraduate mathematicians this term. In this, I’m less concerned about students learning historical facts and more that they gain a general awareness of history of maths while learning about the methods used to study history.

Last week, I decided I would discuss myths and inaccuracies. Though I am aware of a few well-known examples, I was struggling to find a nice, concise debunking of one. I asked on Twitter for examples, and here are the suggestions I received, followed by what I did.

### Happy Birthday Euler!

Today is Euler’s $-306 \times e^{i \pi}$th birthday, and Google have chosen to celebrate (despite ignoring several other prominent mathematical birthdays, including Erdős’s centenary – see the @MathsHistory twitter feed for a full list) by creating a Google doodle on their homepage.

For anyone who isn’t aware, this is when Google changes the image above the search box on the homepage at Google.com, so it still says ‘Google’ but using an appropriate image, which sometimes has built-in interactive elements. I thought it was worth pointing out some of the fantastic maths they’ve included in today’s doodle.

### Open Season – The Perfect Cuboid

In this short series of articles, I’m writing about mathematical questions we don’t know the answer to – which haven’t yet been proven or disproven. This is the second article in the series, and considers a less well-known variant on an extremely well-known problem.

Ask anyone to name a theorem, and they’ll probably come up with one of the really famous ones, like Pythagoras’ theorem. This super-handy hypotenuse fact states that for a triangle with sides A, B and C, where the angle between A and B is a right angle, we have $C^2 = A^2 + B^2$. This leads us on to a nice bit of stamp-collecting – there are infinitely many triples of integers, A, B and C, which fit this equation, called Pythagorean Triples.

One well-known generalisation of this is to change the value $2$ to larger values, and go looking for triples satisfying $C^n = A^n + B^n$. But don’t – Andrew Wiles spent a good chunk of his life on proving that you can’t, for any value of $n>2$, find any such triples. The statement was originally made by Pierre De Fermat, and while Fermat famously didn’t write down a proof, it was the last of his mathematical statements to be gifted one – hence the name ‘Fermat’s Last Theorem’ – and proving it took over 350 years.

### Mathematics: a culture of historical inaccuracy?

Earlier this year, back when I somehow managed to find time to write blog posts (sorry!), I wrote a couple of pieces on incorrect but oft-repeated stories in history of mathematics, basically describing some issues and expressing my frustration. These were Apparently Gauss got in this bar fight with Hilbert… and Why do we enjoy maths history misconceptions?

Today Thony Christie wrote on Twitter (as @rmathematicus) with a link to this post by Dennis Des Chene (aka “Scaliger”): On bad anecdotes and good fun. As Thony points out, this is an “excellent piece of maths history myth busting” and I am writing this quick note to commend you to read it.

### Interesting Esoterica Summation, volume 4

Dust off your thinking hat and do some mind-stretches because here’s another course of Interesting Maths Esoterica! It’s been several months since the last volume so this is quite a big post. I won’t mind if you skim it.

In case you’re new to this: every now and then I encounter a paper or a book or an article that grabs my interest but isn’t directly useful for anything. It might be about some niche sub-sub-subtopic I’ve never heard of, or it might talk about something old from a new angle, or it might just have a funny title. I put these things in my Interesting Esoterica collection on Mendeley. And then when I’ve gathered up enough, I collect them here.