A terrific prime number question from Matt Enlow

A great question from Matt Enlow inspired a super fun conversation with the boys last night:

Before diving in to the project, I’d really recommend thinking about the question – even just for a few seconds – just to see what your intuition tells you.

We started the project by looking at the tweet and trying to make sure that the boys understood the question. The question itself was harder for them to understand than I expected. One reason was that they weren’t used to thinking about ages in terms of days.

Next we went to Mathematica and wrote a little program using the “PrimePi” function which tells you the number of primes less than or equal to a number.

We played around a little bit. Their initial instinct was to zoom in on a specific number like 30 years old. There were some fun surprises since the number of primes between two numbers bounces around a bit. They also had some really interesting ideas about prime numbers.

Eventually they decided to check a range of ages.

At the end of the last video we decided to check a range of ages, and we did that with a “For” loop. Once we did that we found a couple of really fun surprises 🙂

Running the program over night, the largest age that I found was 179,676 years old! I doubt that’s the highest number, though, and I love that the boys thought that there might be infinitely many solutions to this problem.

Thanks to Matt Enlow for posing this problem!

A terrific list of problems from Matt Enlow

Saw a great tweet from Matt Enlow today:

I decided to try out the first problem with my younger son this afternoon and we ended up having a really nice discussion. The problem is:

Is 11 the largest prime number that has all the same digits?

There’s a lot of great math ideas hiding in the problem.

Here’s how we got started – I love hearing the progression of ideas that he has all the way to the end of the movie:

By the end of the last movie he came to the conclusion that if there was a prime number larger than 11 that had all of the same digits, the repeating digit would have to be 1. So, the next thing we did was explore the first couple of numbers made with repeating 1’s:

After realizing that even 11,111 was going to be a challenge to try to factor we end upstairs to play on Mathematica. We made some pretty quick progress! Also, seeing the non-prime results on Mathematica also helped him see some patters in the non-primes that he hadn’t notices before – score one for some computer math!

Finally, I showed him the starting list on the Integer Sequence Database that shows the first few primes of the type we were looking at:

This was a really fun project – thanks to Matt Enlow for sharing this great list of problems!

Sharing John Cook’s Fibonacci / Prime post with kids

Saw a neat post from John Cook about using a fun fact about the Fibonacci numbers to prove there are an infinite number of primes:

Infinite Primes via Fibonacci numbers by John Cook

Funny enough, we’ve played with the Fibonacci idea before thanks to Dave Radcliffe:

Dave Radcliffe’s Amazing Fibonacci GCD post

That project was way too long ago for the kids to remember, so today we started by just trying to understand what the Fibonacci identity means via a few examples:

Next we looked at the idea from Cook’s post that we need to understand to use the Fibonacci identity to prove that there are an infinite number of primes. The ideas are a little subtle, but I think the are accessible to kids with some short explanation:

We got hung up on one of the subtle points in the proof (that is pointed out in the first comment on Cook’s post). The idea is that we need to find a few extra prime numbers from the Fibonacci sequence since the 2nd Fibonacci number is 1. Again, this is a fairly subtle point, but I thought it was worth trying to work through it so that the boys understood the point.

Finally, we went upstairs to the computer to explore some of the results a bit more using Mathematica. Luckily Mathematica has both a Fibonacci[] function and a Prime[] function, so the computer exploration was fairly easy.

One thing that was nice here was that my older son was pretty focused on the idea that we might see different prime numbers in the Fibonacci list than we saw in the list of the first n primes. We saw quickly that his idea was, indeed, correct.

This project made me really happy 🙂 If you are willing to take the Fibonacci GCD property for granted, Cook’s blog post is a great way to introduce kids to some of the basic ideas you need in mathematical proofs.

A fun project on the Arecibo Message inspired by a Holly Krieger Tweet

Saw this neat Tweet from Holly Krieger earlier today:

After reading the post I was super excited to go through it with the boys when they got home from school.

So, we read the post after dinner and then made a code out of snap cubes. Here’s what the boys thought of the post:

and here’s our secret message!

We had a lot of fun with this project. It looks like something that could be pretty fun with a group, too, so I’m thinking about using it for 4th and 5th grade Family Math night at my younger son’s school next month.

Sharing Kelsey Houston-Edwards’s philosophy of math video with kids

Kelsey Houston-Edwards is making a series of math videos and the first two are outstanding. We looked at the first one last week:

Sharing Kelsey Houston-Edward’s video with kids

This week’s video is about philosophy and math. A deep subject, for sure, but one which the kids thought was interesting. Here’s the video (and the twitter link so you know when the new videos appear!):

Here’s my older son’s reaction and a few things he thought were interesting:

and here’s what caught my younger son’s eye:

It is so great to see someone doing such an incredible math outreach program. I’m so excited about this video series!

A fun prime problem I saw in an Evelyn Lamb tweet

Saw this sequences of tweets because of Evelyn Lamb yesterday:


It was a fun problem to play around with and, frankly, solving it was the most impressive thing I did at the gym today so I’ve got that going for me . . . .

My younger son was home sick today, but he was feeling better this afternoon so I thought it would be interested to see what he thought about the problem. It turned into a really nice talk about numbers and arithmetic.

Here’s the introduction to the problem and his first 5 minutes of work:


and here’s his work up to the solution:


This is a really great problem to get kids talking about numbers, arithmetic, and primes. Testing whether the various multiples of 6 are near a prime is a good challenge for kids, too!

Two neat factoring problems for kids

My son is in the review section of chaper 11 of Art of Problem Solving’s Introduction to Algebra book.    I asked him to chose a problem for our movie today and he chose a “greater than / less than” problem that connects to factoring.  It is a nice way for kids to see a connection between arithmetic and algebra:


Since that problem went fairly quickly, I grabbed one of the example problems from earlier in the chapter that had caught my attention. This one is a really neat example of how algebra can help solve an arithmetic problem:


A fun morning – I really love the problems in the Art of Problem Solving books!

A conversation about primes with a 10 year old

My younger son is doing a little review work in Art of Problem Solving’s Introduction to Number Theory book.  This book is a wonderful way for kids to learn all sorts of interesting properties of numbers.  Today he told me that he was looking at a section on “primes and composites.”

So, we talked and the conversation led to a discussion about why there were infinitely many primes.

He remembered the “add one” piece of the proof that there are infinitely many primes, but what that “add one” bit was a key idea wasn’t something that he understood. So we talked some more:

I love how he found his way back to the proof and realized why the “add one” part was important. It was also pretty cool to see that he wasn’t bothered by the fact that the infinite list he was making might not have all of the primes – it was still infinite!

Fun morning 🙂

Last digit counts for the first 1 billion twin primes

I’ve been playing around with the list digits of consecutive twin primes for a few weeks. The idea was inspired by the paper of Lemke Oliver and Soundararajan on consecutive primes described by Evelyn Lamb here:

Evelyn Lamb’s article about the new result about last digits of prime number

All of the data I mention below is in this google doc in the “Improved Twin Prime Sheet” tab:

My google doc with twin prime counts – see the “Improved Twin Prime Sheet” tab

As of today (April 21, 2016) I’ve looked at the last digits of consecutive twin primes through the first 20 billion primes. The 20 billionth prime is 518,649,879,439 and there are 1,020,112,181 twin primes up to that point.

Here’s what the counts look like so far:

So, for example, in consecutive twin primes, the last digit pair (1,3) (1,3) appears just over 108 million times.  The average for each of the 9 counts is just over 113 million.

The recent paper on last digits of consecutive primes gives some insight into how the counts of consecutive primes differ from the average count.  The largest term in their formula for the deviation looks like \ln (\ln (x)) / \ln(x)  and given the theoretical formulas for the distribution of twin primes I expected the deviation for the consecutive twin prime counts might be described by a term of the form \ln (\ln(x) ) / \ln(x)^2.   Here, btw, x is the last prime counted, so about 518 billion.

Sure enough, the deviations from the mean seemed similar to this term:

Subtracting away this term we are left with the following errors:

What caught my eye here is that four of the error terms are much larger than the other ones (and this difference was clear in each of the counts from 1 billion up to 20 billion primes).

Here is where things got strange.  Playing around with those four large errors, I noticed that they were weirdly close to the average count divided by 100*e.    So, as of the last count there were just over 1 billion twin primes, the average count for each of the 9 potential last digit pairs was around 113 million, and dividing that number by 100*e I’m left with 416,976.   The average magnitude of the 4 large errors was 414,953:

This pattern was also evident in all of the counts from prime number 1 billion up to the 20 billionth prime.  Here’s a chart of the ratio of the 1/(100*e) term to the average of these 4 large errors.  The ratio is surprisingly close to 1 at every stage.

This was a big surprise because (if the pattern holds) it would mean that there are slightly more consecutive twin primes with last digits (9,1) (9,1) than there are of the form (1,3) (1,3) and (7,9), (7,9).    The ratio of the (1,3) (1,3) count to the (9,1) (9,1) count would be 1 – 1/(100*e) so just slightly less than 1.

My super limited (and that lack of understanding can’t be emphasized enough) understanding of the k-tuples conjecture of Hardy and Littlewood is that the counts of the different last digits of consecutive primes would all be equal as the counts tended to infinity.  So, if this strange 1/(100*e) term sticks around that would mean that consecutive twin primes are just a little bit different than consecutive primes.

I don’t know enough number theory to even begin to understand why any of these deviations actually happen.  Following the ideas from the paper of Lemke Oliver and Soundararajan and correcting for this strange 1/(100*e) term, you get pretty amazing approximations to the last digit counts of consecutive twin primes, though.  Here are the errors the counts so far – remember the average count is 113 million, and just correcting for the \ln(\ln(x)) / \ln(x)^2 term and this 1/(100*e) term reduce the errors down to around 1 part in 1000:

Again, I don’t know enough number theory to understand (much less explain) the structure that I’m seeing, but it sure has been interesting to play around with it and see some of this structure emerge.





The last digits of twin primes

I spent the last few weeks playing around with the last digits of 3 consecutive primes. It was a fun project inspired by this new discovery about primes that Evelyn Lamb discusses here:

Peculiar Pattern Found in “Random” Prime Numbers

The data about the distribution of the last digits of three consecutive primes is in this spreadsheet:

My prime triple counting data

My next project involves looking at the distribution of the last digits of twin primes. The first result doesn’t seem that surprising – the last digits (1,3), (7,9) and (9,1) for twin primes seem to occur with roughly the same frequency:

Twin primes with last digit (a,b) occur this many times in the first billion and 2nd billion primes

(1,3) occurs 19,349,298 times and 18,144,757 times,
(7,9) occurs 18,349,510 times and 18,143,078 times, and
(9,1) occurs 19,348,370 times and 18,145,486 times.

Again, not really a surprise. The next thing I’ve started to look at is twin prime pairs – so when twin primes with last digits (1,3) occur, what are the last digits of the next twin primes?

[April 3, 2016 note. Dave Radcliffe pointed out to me that I had the order backwards:

I’m actually surprised that the code worked at all given that the counts were flipped from how I intended to write them, but thanks to Dave for noticing that the counts were flipped ]

Here are the results in the first 10 million primes:

(1,3) is followed by (1,3) 76,109 times
(1,3) is followed by (7,9) 88,965 times
(1,3) is followed by (9,1) 81,374 times

(7,9) is followed by (1,3) 82,139 times
(7,9) is followed by (7,9) 75,825 times
(7,9) is followed by (9,1) 88,438 times

(9,1) is followed by (1,3) 88,200 times
(9,1) is followed by (7,9) 81,612 times
(9,1) is followed by (9,1) 75,933 times

In the first billion primes the numbers were

(1,3) is followed by (1,3) 6,101,617 times
(1,3) is followed by (7,9) 6,798,862 times
(1,3) is followed by (9,1) 6,448,819 times

(7,9) is followed by (1,3) 6,475,915 times
(7,9) is followed by (7,9) 6,105,438 times
(7,9) is followed by (9,1) 6,768,157 times

(9,1) is followed by (1,3) 6,771,766 times
(9,1) is followed by (7,9) 6,445,210 times
(9,1) is followed by (9,1) 6,131,394 times

In the 2nd billion primes the numbers were:

(1,3) is followed by (1,3) 5,752,468 times
(1,3) is followed by (7,9) 6,340,717 times
(1,3) is followed by (9,1) 6,051,573 times

(7,9) is followed by (1,3) 6,071,883 times
(7,9) is followed by (7,9) 5,756,302 times
(7,9) is followed by (9,1) 6,314,893 times

(9,1) is followed by (1,3) 6,320,406 times
(9,1) is followed by (7,9) 6,046,059 times
(9,1) is followed by (9,1) 5,779,020 times

So, similar to the last digits of the prime numbers, consecutive sets of twin primes do not all occur with the same frequency.

I’ve given no thought at all to what I’d expect the distribution to look like, but I’m interested to see what the results look like for the first few billion primes and see what the results look like.