# Using Richard Green’s post about complexity of a number with kids

Saw a another great Google+ post from Richard Green today:

It is so great to see ideas from research mathematicians that you can use with kids. We’ve actually used a couple of Green’s posts before:

Another great piece of math to share with kids from Richard Green

Using a Richard Green Google+ post to talk about geometry with my son

Tonight I was looking for a quick little project since I’ll be on the road for work tomorrow, and talking about the complexity of a few numbers seemed like it would be a lot of fun.

(oh, and sorry for the poor lighting, we were working on the floor of the study while my wife was watching football . . . )

I started with my younger son – he caught on to the idea of complexity quickly and even formed a nice little conjecture about the complexity of prime numbers. The conjecture turned out to be false, but it helped him understand a new way to compute complexity. He even wondered about how you’d compute the complexity of big numbers.

My older son also found computing the complexity of a number to be interesting. We ended up talking for about 8 minutes, so I split the video into two pieces.

He also caught on to the idea fairly quickly and chose to compute the complexity for 10 first. After that he tried 13 and, similar to my younger son, he thought you’d need 13 1’s because 13 is prime. However, with a little more thinking he found a way with 9 1’s and then eventually 8.

In the second half of the conversation I asked him to come up with a few other things to explore. He thought it would be tough to come up with a general formula. I decided to show him one thing that might be a little surprising – if a > b, the complexity of a isn’t necessarily greater than the complexity of b.

After that he wondered what the smallest possible value of the complexity for a two digit number. He had some ideas that led him to believe the smallest complexity would be 7.

To wrap up, we guessed at the value of the complexity for 100.

So, a great post from Richard Green that isn’t too hard to use with kids. It is so fun to be able to share ideas from math research with kids. This idea from Green was especially fun because it got the boys thinking about numbers in ways that are a little different than usual. Amazing what you can do (and what is unsolved!) with just addition and multiplication with 1’s ðŸ™‚

# Has the Perfect Cuboid problem been solved?

A little over two years ago I learned of a neat unsolved problem in math. Does there exist a “perfect” cuboid – a brick-like shape with all sides and diagonals (including the long diagonal) having integer values.

The problem made for a fun Family Math project:

The problem also came up in a project inspired by a Patrick Honner post:

Mr Honner’s triangle and a surprising unsolved problem

Today Justin Lanier pointed out this post on Twitter:

I do not believe that papers on Arxiv.org have been reviewed, so for now the best I can do is hope that this paper stands up to scrutiny. It would be pretty neat to see this fun unsolved problem actually get solved.

# The Collatz conjecture and John Conway’s “amusical” variation

I enjoy looking at unsolved math problems with the boys.Â  Although there aren’t too many of these problems that are accessible to kids, some of the ones that they can understand are pretty neat.Â  Today I decided to return to the Collatz conjecture and present a “new to me” twist on the problem described by John Conway in his essay “On Unsettleable Arithmetical Problems.”Â  I saw the essay in the book pictured below, which I cannot recommend highly enough:

We began by taking a fresh look at the Collatz Conjecture.Â  The statement of this particular unsolved problem involves only a little bit of arithmetic and talking about this problem is a really great way to show some interesting math and build up a little number sense at the same time.Â  Here is the problem:

Step 1:Â  Pick any positive integer $n$.
Step 2:Â  If $n$ is even divide it by 2, and if $n$ is odd multiply it by 3 and then add 1.
Step 3:Â  Repeat step 2 with the number you ended up with after step 2, but stop if you ever get to 1.

For example, if you start with the number 3 you get the sequence:Â Â  3, 10, 5, 16, 8, 4, 2, 1.

For any number that has ever been tested, whether by hand or by computer, the sequence always ends up at 1.Â  The Collatz conjecture states that every integer will end up at 1 eventually.Â  Although many people believe that this conjecture is indeed true, it has not been proven to be true.

Here is our introductory discussion of the problem:

In the second part of our project today I introduced the twist on the Collatz conjecture that Conway describes in his essay:

Step 2:Â  If the integer from the previous step is of the form:

2.a:Â  2k, make a new integer 3k,
2.bÂ  4k + 1, make a new integer 3k + 1,

2.cÂ  4k – 1, make a new integer 3k – 1.

Step 3:Â  Repeat step 2 until you encounter a number you found previously.

For example, if we start with the number 4, we get the sequence:Â  4, 5, 9, 7, 5, and then back to 4.

As with the Collatz problem, there’s not much that mathematicians have been able to say about this new problem.Â  There are a few known cycles, like the example above, but for most integers the sequence you get from following Conway’s process seems to go on forever without repeating.

In our introductory talk about this new problem we go through one example and then spend a little bit of time talking about why all positive integers are either even (step 2a above), one more than a multiple of 4 (step 2b), or one less than a multiple of 4 (step 2c).Â  This discussion hints at a basic idea in number theory called modular arithmetic.

Next we talked about why Conway’s problem is a little bit different than the Collatz conjecture.Â  One of the things that’s really interesting is that you can run the computations in Conway’s problem both forwards and backwards.Â  You can’t do that in the Collatz problem because multiple numbers can map to the same number.Â  For example, in the Collatz problem the number 10 can come from dividing 20 by 2 or by taking 3 and multiplying it by 3 and adding 1.Â  That means you can’t go backwards from 10.
In his article Conway plots a few of the sequences that arise in the new problem (actually, he plots the logarithm of the sequence, but that’s a detail I’ll put to the side for now).Â  The plots look surprisingly similar to the letter V.Â  The shape of those graphs was really surprising to me.

Because there is a connection between the number 12 and Conway’s version of the Collatz problem, he calls the pattern in the numbers you get by following the new process “amusical.”Â Â Â  I’ll leave the description of why to him, save for this bit of mathematical comedy:

“However, since the series always ascends by a fifth modulo octaves, it does not sound very musical, and it has amused me to call it amusical.”

The connection, or lack of a connection, to music seemed to be a neat thing to illustrate for the boys, so I used Mathematica’s Sound function to create a sound for each number in a particular sequence.Â  This part was just for fun, but watching it just now I wish I would have described the process a little better.Â  At least you can see the Mathematica code on the screen and copy it if you want.Â  The boys really liked hearing the music, though, and played around with the different sounds a little bit after we finished:

So,Â  aÂ  really fun project going through two unsolved math problems.Â  Conway uses these problems as examples of problems that may actually be no way to solve.Â  That’s an interesting topic, too, though more than I wanted to get into today.Â  For now the goal was to show some fun math and continue to build up their number sense.Â  I really enjoyed this project.

# Grothendieck, Heron, and Brahmagupta

My son is taking the AMC 8 today so I thought we’d have sort of a light morning with math.Â  The section of the book we were meant to cover today was Heron’s formula for the area of a triangle.Â  Not exactly a “light” subject if you delve into the proof!Â  Instead, I took today as an opportunity to talk a little math history.

Quite a bit after Heron, in the 600’s actually, the Indian mathematician Brahmagupta found an amazing generalization of Heron’s formula.Â  Brahmagupta’s formula calculates the area of a cyclic quadrilateral and the triangle is a special case when one of the sides has length zero.

Though I know very little of the mathematics that Grothendieck actually studied, I took the example of Brahmagupta finding Heron’s formula as a special case of his formula as an example of solving a problem via generalization.Â Â  In the pieces I’ve read about Grothendieck in the last few days, his ability to find the right generalization of a given problem seemed to be one of his great gifts that the writers focused on.Â  The analogy with Heron’s formula and Brahmagupta’s formulaÂ  appeared to my best shot at mentioning Grothendieck’s contribution to math to my son.

The first video introduced Heron’s formula and discussed a little bit of history.

The next part of our talk introduced Brahmagupta’s formula and talked about why the triangle is (possibly!) a special case of this formula.Â  For it to be a special case, we just need to show that you can circumscribe a circle about any triangle.

In the next video we try to see if it is possible to always circumscribe a circle about a triangle.Â  This led to a discussion of a slightly easier problem – how do you find the set of points that is an equal distance from two given points?Â  Solving that problem leads to the idea that it may, in fact, always be possible to draw a circle that hits all three verticies of a triangle.

Finally, we jump over to the kitchen table to try to construct the circumcircle of a given triangle.Â  It is a neat construction and it is always a nice surprise when you get the three perpendicular bisectors to intersect in a single point!

So, a fun morning showing a little math history and a couple of really amazing geometry formulas.Â Â  Nice to have a light day every not and then.

# Sphere packing (well . . . circle packing)

Got home late last night from Boston and we all slept in.Â  Had a fun probability problem planned but a few other morning activities didn’t leave us with time for today’s Family Math project, so I switched gears.

The problem of finding the most efficient way to pack spheres was only solved recently.Â  It is one of those “really easy to understand, but super hard” math problems that I think lots of folks will find interesting.Â  I actually don’t know much about it, sadly, but thought the kids would have fun playing around with a simplified version of the problem.

First, though, if you want to see the history of the problem Wikipedia’s Sphere Packing page is a good starting point:

Next we tried to find some other ways to pack the circles.Â  My younger son thought about the idea of packing the circles in a line.Â Â  I’d not thought about that idea so I was happy to hear it.Â  My older son noticed that you could chop up our existing packing into three rectangles to make the linear shape, so the area of this new linear shape would be the same.Â Â Â  I was pretty excited to see this geometric reasoning rather than having to figure out how to fit the 9 disc in a row on camera!

After considering packing the circles in a line we looked for a new shape.Â Â  There is a non-symmetric way to pack the circles that minimizes the “wasted” area on the inside, but pushes some of that waste to the outside.Â  For our example with 9 circles, the two packing shapes had really similar areas – 625 square inches before vs 638 square inches now.Â  I wish I had 16 of these golf discs to check these two arrangements for the next larger square!

So, a hastily put together project but hopefully an exciting one.Â  I like showing the boys easy to understand unsolved (or recently solved) problems from pure math.Â  This one has the extra nice advantage of actually being able to hold it in our hand!Â  Fun morning.

# A fun surprise with Euler’s identity coming from Manjul Bhargava’s generalized factorials

Earlier this week I wrote about a really neat paper by one of the 2014 Fields Medalists Manjul Bhargava. My original post is here:

Fibonacci Factorials

and Bhargava’s fascinating paper is here:

The Factorial Function and Generlizations

I was thinking about the paper today because one of the questions Bhargava poses in the paper was stuck in my mind.Â  Near the end Bhargava asks about the analogue of the exponential function:

$e^x = \sum_{k = 0}^{\infty} \frac{x^k}{k!}$

for the generalized factorial function.Â  It certainly seems that for the generalized factorials, we’ll see many different values for “e”.

I also thought that it might be fun to look at the Taylor expansions for cos(x) and sin(x) and see if there was any analogue to the formula $e^{\pi i} = -1$ for the generalized factorials.Â  I got a fun little surprise when I got home and played around a little.

My idea during the day was to pretend that first positive root of sin(x) was the analog to $\pi$ for generalized factorials and that evaluating the exponential function above at x = 1 was the analog for e.Â Â Â Â  When I tried to estimate these values for the Fibonacci Factorials that I’d found previously, I didn’t notice anything interesting.Â  I then moved on to looking at the example that Bhargava gives in the paper – generalized factorials over the prime numbers.Â Â Â  For the generalized factorial function over the primes we get the following values for the first 10 factorials:

0! = 1
1! = 1

2! = 2

3! = 24

4! = 48

5! = 5760

6! = 11,520

7! = 2,903,040

8! = 5,806,080

9! = 1,393,459,200

10! = 2,786,918,400

I calculated up to 19! in order to use 10 terms each in the series for Sin(x) and Cos(x).Â Â Â  Here’s what the graphs for Sin(x) and Cos(x) looked like for x between 0 and 6 when we use the first 10 terms of the Taylor series for both functions:

y = Sin(x) = $x - x^3 / 3! + x^5 / 5! - x^7 / 7! . . .$

and here’s what y = Cos(x) = $1 - x^2 / 2! + x^4 / 4! - x^6 / 6! + . . .$ looked like over the same interval:

As you can see from the two graphs, the usual identity $Sin(x)^2 + Cos(x)^2 = 1$ does not hold in this setting!

You can also see from the graph that the first positive root of Sin(x) is a little bit larger than 5.Â  According to Mathematica, the root is approximately x = 5.1819247.Â Â Â  So in this setting the analogy we have is that $\pi \approx 5.18. . .$

Now for the surprise.Â  Cos(x) evaluated at that root is equal to 1 to quite a high precision.Â  A high enough precision, in fact, that Mathematica simply returns the value 1.Â  I have not done enough work even to know how to calculate the remaining (infinitely many, ha!) factorials and see if that result holds in general.Â  Actually, I doubt that calculation is even within the realm of something that I could do.Â  However, if the result does hold in the general case rather than just when we approximate the various Taylor series with 10 terms, it would mean that when you evaluate Bhargava’s generalized factorials over the primes, and use the analogies for e and $\pi$ that I mention above, you get the amazing and quite surprising identity that $e^{\pi i} = 1$

[ post publication edit – I think I can prove it!! but it’ll have to wait until after work tomorrow]

[ Further – the proof uses Dirchlet’s Theorem on primes and arithmetic progressions. I will try to write up the proof more carefully when I have a little more time, but the idea is that for a given prime p, Dirchlet’s theorem tells us that there are infinitely many primes with remainder 1,2,3, . . . , and p – 1 when divided by p. This means that Bhargava’s factorials over the primes will add new powers of p in steps of p – 1 after the $p^{th}$ step. But for odd primes, since p – 1 is even it will be only in the odd numbered factorials where the powers of odd primes increase. Furthermore , the even steps will increase the previous odd step by multiplying by 2. You can see the beginning of these patterns in the list above.

What this all means is that Bhargava’s prime factorials have some interesting relations. One in particular is that 2* (2n – 1)! = (2n)!. When you look at the power series for $e^x, Cos(x),$ and $Sin(x)$ you can see that this simple relation implies that $Cos(x) = 1 - (x / 2) * Sin(x).$Â  Thus, when $Sin(x) = 0, Cos(x) = 1$. Since my analogy for $\pi$ in this setting was the first positive root of $Sin(x)$, this all shows that for factorials over the primes it seems that the the analogy for Euler’s formula is:Â  $e^{\pi i} = 1.$ Fun!

# Fibonacci Factorials

As part of the publicity around the Fields Medal announcement, the American Mathematical Monthly’s Facebook page pointed out this paper written by Manjul Bhargava in 2000:

The Factorial Function and Generalizations

The reason that this paper caught my attention is that I actually felt like I had a prayer of understanding the ideas that the paper was explaining.Â  I’m sure, of course, that the work of all of the 2014 Fields Medal winners is off the charts brilliant, but when I searched for lectures or papers by them everything but this paper was miles over my head.Â  So many miles, actually, that the factorial function might come in handy if I needed to describe that distance accurately!

One particularly helpful example that Bhargava gives in the paper is on top of the 6th page (page number 788) where he calculates the first six values of the generalized factorial function over the primes.Â  Since he said that it was “an easy matter to compute” these six values, I thought that replicating this calculation would be a fun way to see if I had understood some bits of the paper.Â Â Â  After a few times through the paper I finally had understood the ideas well enough to replicate the calculation, so yay!Â  I was also surprised to see that those six numbers (1,1,2,24,48, and 5760)Â  appear in the On-line Encyclopedia of Integer Sequences only once (and without reference to Bhargava’s result):

Is this the full generalized factorial function over the primes?

I don’t know if the full sequences would match each other (or, obviously, why that sequence would arise from the Taylor series of $log(1 + x)^2 / \sqrt{1 + x}$) but at least my calculation of the next term in Bhargava’s sequence does match the next term in the OEIS example.

So, having (hopefully) understood how to calculate this generalized factorial function over the primes, I wanted to try it for another sequence of integers.Â  The Fibonacci numbers seemed like as good a place as any to start, so I gave that a shot this weekend.Â  Unluckily I was traveling this weekend, but still found a little time early this morning at the Lone Wolf diner in Amherst, MA to get things going while enjoying their Santa Fe omelette.Â Â Â  According to my calculations, Bhargava’s factorial function over the Fibonacci numbers would evaluate as follows:

0! = 1

1! = 1

2! = 2

3! = 6

4! = 24

5! = 240

6! = 720

7! = 443,520Â  ($2^7 * 3^2 *5 * 7 * 11$)

8! = 443,520 (yes, the same as 7!.Â  That’s a surprise, but I haven’t been able to see the mistake)

9! = $2^8 * 3^4 * 5 * 7 * 11* 13$ = 103,783,680

10! = $2^9 * 3^4 * 5^2 * 7 * 11* 13$ = 1,037,836,800

[edit note:Â  after publishing earlier today, I noticed that I left of the 13 on both 9! and 10! ]

Fingers crossed that these are the correct calculations but since I slept at a farm last and was woken up early by roosters, it wouldn’t be super surprising if there was an error ðŸ™‚Â  In any case, one interesting thing that I learned playing around with this is that the Fibonacci numbers have an interesting pattern modulo 11.Â Â  I’m hoping to play around with this and other sequences in the next month.Â  I think there is a really fun project for kids hiding in here somewhere, too.

# A little non-standard fun with Logs

Sorry this one is a little rushed, but I woke up today to see this post on Twitter:

By lucky coincidence I’ve just been talking about logs and exponentials with my older son.Â  By unlucky coincidence he’s been sick for a few days, but he was feeling well enough this morning to talk a little.Â  I thought it would be fun to try to answer the question on twitter with a few non-standard log examples for kids.

The goal was just to show a few examples that don’t appear to have anything whatsoever to do with logs.Â  I’m not trying to go into any detail, just wanted to show some fun and unusual math results.

The first bit of the talk was to switch from log base 10 to log base e.Â  The first result we talked about was that the area under the curve y = 1/x from 1 to x is equal to ln(x), followed by a couple of surprising results related to that:

The next part of the talk was about the distribution of prime numbers.Â Â  There are so many amazing results here that it was hard to even understand how to limit the talk to 5 minutes.Â  I ended up choosing three ideas – the approximate number of primes less than n, the approximate number of twin primes less than n, and the amazing Erdos-Kac theorem:

The last part of the talk was about the famous equation $e^{\pi*i} + 1 = 0$.Â  We’ve spent a little time in the past talking about this equation, so it wasn’t the first time he’s seen it.Â  The nugget I wanted to extract out of the equation this time around was that this equation allows us to talk about ln(-1).Â Â  After the video I explained some of the complications that arise when you talk about logs of negative numbers, but those details weren’t important for this talk.Â  For now, all I wanted to show is that ln(-1) might be equal to $\pi * i$.

So, the nice little question on twitter made for a fun morning.Â  Not sure this is exactly the answer that anyone was looking for, or if it is even an answer at all, but it was neat to have these conversations with my son this morning.

# Powers, Logic, and Prime Numbers

Yesterday we had quite an adventure with Graham’s number.Â  I wanted to have one more talk about powers before the weekend was over,Â  so the topic I chose for today was Fermat’s Little Theorem.Â Â  I wasn’t planning on going into too much depth on the number theory side, but I did want to emphasize a little bit of logical thinking and just walk through a few basic computations with powers.

We started with a quick introduction to Fermat’s Little Theorem and then computed an easy example with the number 5.Â  After that we talked a little bit about the logic – prime numbers satisfy Fermat’s Little Theorem, so if a number fails to satisfy Fermat’s Little Theorem, then it must not be prime:

Next we moved on to a couple of slightly more complicated examples.Â  First we took a look at 21 and tried to find the remainder when $2^{20}$ is divided by 21.Â  I told them that we only needed to worry about the remainders, which is fine for today.Â  We’ll cover the details behindÂ  that idea sometime later on when we study number theory.Â  It was fun, though, just to show that you could compute the remainder when $2^{20}$ is divided by 21 without even knowing what the exact value of $2^{20}$ is!

We also discussed a number that satisfies the conditions of Fermat’s Little Theorem that isn’t prime – 1,729.Â  We didn’t go into the calculations, but did tell a fun and famous story about 1,729.

Finally, we couldn’t spend the morning talking about Fermat’s Little Theorem without mentioning Fermat’s Last Theorem. We walk through a few examples of triples that satisfy the Pythagorean Theorem and talk through what Fermat’s Last Theorem says.Â  We conclude by mentioning a few famous problems in math that remain unsolved.

Between yesterday’s discussion of Graham’s number and this one on Fermat’s Little theorem, it wasÂ  definitely a fun weekend of math.

# Sierpinski’s triangle and snap cubes.

Our math friend (and professional Ultimate player !!) Federico Chialvo sent us the following link on twitter last night:

http://www.datapointed.net/visualizations/math/factorization/animated-diagrams/

Such a neat visual pattern.Â  The kids really liked it.

As we watched the different patterns fly by, my youngest son noticed that the pattern for the number 243 looked a lot like Sierpinski’s triangle.Â  That observation gave rise to our Family Math exercise this morning:

So glad I bought these snap cubes!

Interestingly, after we finished my youngest asked how our pattern today related to the one from the Chaos Game:

https://mikesmathpage.wordpress.com/2013/12/01/computer-math-and-the-chaos-game/

In the Chaos Game we had a little computer program that ran 10,000 iterations and produced a picture that looked like Sierpinski’s triangle.Â  He knew that 10,000 wasn’t a power of 3 and that didn’t reconcile with today’s exercise in his mind.Â  Good question.

On a side note, check out Federico’s fun blog post about the Collatz Conjecture: