Puzzlebomb is a monthly puzzle compendium. Issue 56 of Puzzlebomb, for August 2016, can be found here:

Puzzlebomb – Issue 56 – August 2016

The solutions to Issue 56 will be posted at the same time as Issue 57.

Previous issues of Puzzlebomb, and their solutions, can be found at Puzzlebomb.co.uk.

]]>This week I lured David into my office with promises of tasty food and showed him some sequences I’d found. Thanks to (and also in spite of) my Windows 10 laptop, the whole thing was recorded for your enjoyment. Here it is:

I can only apologise for the terrible quality of the video – I was only planning on using it as a reminder when I did a write-up, but once we’d finished I decided to just upload it to YouTube and be done with it.

We reviewed the following sequences:

A075771

Let $n^2 = q \times \operatorname{prime}(n) + r$ with $0 \leq r \lt \operatorname{prime}(n)$; then $a(n) = q + r$.1, 2, 5, 4, 5, 12, 17, 10, 15, 16, 31, 36, 9, 28, 41, 48, 57, 24, 31, 50, 9, 16, 37, 48, 49, 76, 15, 42, 85, 116, 79, 114, 137, 52, 41, 96, 121, 148, 27, 52, 79, 144, 139, 16, 65, 136, 109, 84, 141, 220, 49, 86, 169, 166, 209, 254, 33, 124, 169, 240, 55, 48, 297, 66

A032799

Numbers $n$ such that $n$ equals the sum of its digits raised to the consecutive powers $(1,2,3,\ldots)$0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 89, 135, 175, 518, 598, 1306, 1676, 2427, 2646798, 12157692622039623539

]]>

A002717

$\lfloor n(n+2)(2n+1)/8 \rfloor$0, 1, 5, 13, 27, 48, 78, 118, 170, 235, 315, 411, 525, 658, 812, 988, 1188, 1413, 1665, 1945, 2255, 2596, 2970, 3378, 3822, 4303, 4823, 5383, 5985, 6630, 7320, 8056, 8840, 9673, 10557, 11493, 12483, 13528, 14630, 15790, 17010, 18291, 19635, 21043, 22517

The Carnival rounds up maths blog posts from all over the internet, including some from our own Aperiodical. See our Carnival of Mathematics page for more information.

]]>Puzzlebomb is a monthly puzzle compendium. Issue 55 of Puzzlebomb, for July 2016, can be found here:

Puzzlebomb – Issue 55 – July 2016 (printer-friendly version)

There’s also an online electronic version of the puzzle in this issue.

The solutions to Issue 55 can be found here:

Puzzlebomb – Issue 55 – Solutions – July 2016 (printer-friendly version)

Previous issues of Puzzlebomb, and their solutions, can be found at Puzzlebomb.co.uk.

]]>Year 1, Semester 1: I had three two-hour exams. One was 9am on Monday, the second was 9am on Tuesday and the third was 4.30pm on the same Tuesday.

Year 1, Semester 2: I don’t have this exam timetable, for some reason. (The real question is why I still have five out of six, not why I’m missing one!)

Year 2, Semester 1: six two-hour exams over two weeks. Week 1 started fairly well, with exams on Monday 9am, Wednesday 4.30pm and Friday 4.30pm, then the fourth was Saturday 9am, so I finished at 6.30pm on Friday and took another at 9am the following morning. The remaining two were on the following Tuesday, at 9am and 4.30pm.

Year 2, Semester 2: another six two-hour exams over two weeks. The first week was Tuesday at 4.30pm, Wednesday at 9am, Wednesday at 4.30pm and Thursday at 4.30pm. Notice I am given a whole 22 hours off between the 3rd and 4th, a comparative luxury! Then the last two were Tuesday and Wednesday the following week, both at 9am.

Year 3, Semester 1: much more relaxed this time, five exams mostly 2.5 hours on Monday at 1.30pm, Wednesday at 9am and Thursday at 9am one week and Monday 9am and Wednesday 9am the following week.

Year 3, Semester 2: three 2.5 hour exams, two on Friday, 9am and 4.30pm and the other on the following Monday at 9am.

So it seems I was expected to either do minimal revision before each exam or to do revision in advance of the exam period and simply retain a good level of knowledge and practice for, say, six hours of exams on three different subjects in a 34-hour period (Y1, S1) or eight hours of exams on four different subjects in a 50-hour period (Y2, S2).

This doesn’t change my sympathy with students who feel their exams could be more spread out. This is important so that they have plenty of time for revision and can fairly represent themselves, refreshed and at their best. It strikes me that with the sort of exam schedules I had, and with the weightings given to exams, if a student woke with a cold that lasted a few days, that could seriously damage half a semester’s work.

I’m trying to tweak what I’ve written above so it doesn’t sound whiny – that isn’t my intention, I’m aware that others have it worse. I’m reminded of the bit from my George Green talk (listen here), where when Green sat the Cambridge Tripos in 1837, this was a five-day examination, 9-11.30 and 1-4pm on Wednesday-Saturday and Monday, that determined the order of merit for the Bachelor’s degree!

Another memory confirmed by these papers is that the Monday 9am exam at the end of year 3 served as both the end point of my degree and also my 21st birthday. One thing I am genuinely surprised by is that I didn’t take a 3 hour exam on any of these timetables – I’ve definitely claimed in recent years during a conversation on exam lengths to have regularly taken three hour exams. Funny thing, memory.

]]>`1`

) and no glitter (`0`

) to encode binary messages in your nail varnish. We also posted an accompanying puzzle, stated as:
**Suppose I want to paint my nails on one hand differently every day for a month – so I need to use all 31 combinations involving glitter. Assuming that a nail painted with plain varnish can have glitter added, but a nail with glitter needs to be nail-varnish-removed before it can become a plain nail again, what order do I apply the different combinations so that you minimise the amount of nail varnish remover I’ll need to use?**

Here’s our take on the solution.

First of all, there’s a slightly subtle point to note – there’s a similar question you can ask, to which there is an easy and well-known answer. If instead we were asking how to minimise **the number of times I need to change a nail**, either from glitter to no glitter or back again, that’s the same as asking how to minimise the number of flips from 0 to 1 or from 1 to 0. The answer to this is to use a *Gray code*.

A Gray code – sometimes known as reflected binary code, and named after its creator Frank Gray – is an ordering of numbers such that each successive pair of numbers differ in only one bit (binary digit). Patented in 1947, it was originally designed to minimise errors in mechanical switching systems – if more than one switch has to flip to change between two numbers, they might not flip at exactly the same time, so the output might temporarily read or print out a number unintentionally. In the conventional order, binary numbers sometimes involve flipping multiple bits – such as going from 3 (`011`

) to 4 (`100`

), in which all three bits flip; the Gray code is an alternative ordering that can be worked out for any set of numbers $0 \ldots 2^n-1$ to ensure each switch is only one digit – for example, the numbers 0 to 7 can be written in the following order with only single bit-flips:

0 | `000` |

1 | `001` |

3 | `011` |

2 | `010` |

6 | `110` |

7 | `111` |

5 | `101` |

4 | `101` |

In fact, the binary combinations above are referred to as the *Gray code* for the numbers 0 to 7, in that order, so Gray code for 2 is 011 (even though that’s 3 in binary).

A Gray code for an $n$-bit sequence can be constructed from the $(n-1)$-bit Gray code, in quite a pleasing way. To go from 2-bit to 3-bit, take the sequence for 2-bit:

`00`

, `01`

, `11`

, `10`

Add a reflected version of this same string to the end:

`00`

, `01`

, `11`

, `10`

, `10`

, `11`

, `01`

, `00`

Then prefix the first half with `0`

s and the second half with `1`

s:

`000, `

`001`

, `011`

, `010`

, `110`

, `111`

, `101`

, `100`

This process can be repeated to generate the 4-bit sequence, and so on.

Since its creation, the Gray Code has been used in error correction and digital logic, and it can also be used to solve the Towers of Hanoi puzzle. As far as I know, the present work is the first application to personal grooming.

So, if I were to use the Gray Code ordering for my nails, I’d get the following sequence:

Order | Gray Code | Decimal equivalent | Order | Gray Code | Decimal equivalent | Order | Gray Code | Decimal equivalent |
---|---|---|---|---|---|---|---|---|

0 | `00000` |
0 | 11 | `01110` |
14 | 22 | `11101` |
29 |

1 | `00001` |
1 | 12 | `01010` |
10 | 23 | `11100` |
28 |

2 | `00011` |
3 | 13 | `01011` |
11 | 24 | `10100` |
20 |

3 | `00010` |
2 | 14 | `01001` |
9 | 25 | `10101` |
21 |

4 | `00110` |
6 | 15 | `01000` |
8 | 26 | `10111` |
23 |

5 | `00111` |
7 | 16 | `11000` |
24 | 27 | `10110` |
22 |

6 | `00101` |
5 | 17 | `11001` |
25 | 28 | `10010` |
18 |

7 | `00100` |
4 | 18 | `11011` |
27 | 29 | `10011` |
19 |

8 | `01100` |
12 | 19 | `11010` |
26 | 30 | `10001` |
17 |

9 | `01101` |
13 | 20 | `11110` |
30 | 31 | `10000` |
16 |

10 | `01111` |
15 | 21 | `11111` |
31 |

Each time I change from one nail to the next, I’m changing exactly one nail – either adding glitter, or removing it, and this is undeniably the most efficient way. But the question we asked in our puzzle was slightly different – since it’s much more effort to remove nail glitter than to add it, can we minimise the number of glitter removals, i.e. changes from 1 to 0?

If you’d like to try and work it out for yourself, go and do that now.

The first question you might ask is, is Gray Code the answer here too? In the list given above, there are 15 instances of switching from a 1 to a 0. But it can be done in fewer!

Our first breakthrough here was to find a solution more efficient than the Gray Code ordering, and we did find an ordering which takes 14 removes (for the record, it was 0, 2, 3, 1, 5, 4, 6, 7, 11, 10, 8, 9, 13, 12, 14, 15, 23, 22, 20, 21, 17, 19, 18, 16, 24, 26, 27, 25, 29, 28, 30, 31). But can we do any better?

It’s actually possible to prove that the lower bound on this — the fewest removals any valid solution can have — is 13. Let’s assume that each move consists of removing or adding exactly one nail’s glitter, and note that there are 31 ‘steps’ to achieve all 32 positions. If you start with no nails glittered and finish with all five glittered, the difference between the number of moves adding and removing glitter must be at most five, and therefore the minimal solution in terms of removals must have 18 adds and 13 removes making up the 31 steps.

All we need now is to actually find a way of doing it with only 13 removals. Ooh, here’s one:

Order | Binary | Decimal Equivalent | Order | Binary | Decimal Equivalent | Order | Binary | Decimal Equivalent |
---|---|---|---|---|---|---|---|---|

0 | `00000` |
0 | 11 | `01000` |
8 | 22 | `10010` |
20 |

1 | `00001` |
1 | 12 | `01010` |
10 | 23 | `10011` |
22 |

2 | `00011` |
3 | 13 | `01011` |
11 | 24 | `10111` |
23 |

3 | `00010` |
2 | 14 | `01111` |
15 | 25 | `10101` |
21 |

4 | `00110` |
6 | 15 | `01110` |
14 | 26 | `10001` |
17 |

5 | `00111` |
7 | 16 | `11110` |
30 | 27 | `10011` |
19 |

6 | `00101` |
5 | 17 | `11100` |
28 | 28 | `11011` |
27 |

7 | `00100` |
4 | 18 | `11000` |
24 | 29 | `11001` |
25 |

8 | `01100` |
12 | 19 | `11010` |
26 | 30 | `11101` |
29 |

9 | `01101` |
13 | 20 | `10010` |
18 | 31 | `11111` |
31 |

10 | `01001` |
9 | 21 | `10000` |
16 |

One obvious way to find the most efficient solution is to crunch it all through a computer: generate all the possible orderings, and count how many removals you need in each case. Of course, this would take a huge amount of computer time – the number of possible orderings is 32!, which is 263130836933693530167218012160000000, and as you can see below in the results of a simulation of 126,000 randomly-chosen orderings in R, only a tiny proportion achieve fewer than thirty removals, let alone thirteen.

So instead of relying on luck, we used a bit of *maths thinking*. The standard Gray Code that will solve you the Tower of Hanoi looks like this

\[1213121412131215121312141213121\]

where each digit represents the nail you change at each step (or which disk you move to a new peg). The problem with the standard solution for our purposes is that, starting with five unglittered nails, it doesn’t end with all fingers glittered — it ends with only digit 5 glittered. Fortunately, it’s easy to modify the sequence to change this.

Consider the simpler case of a three-fingered mathematician. They can imagine their nail-painting journey as a trip round the edges of a cube visiting every corner, with forwards and backwards movemement in each of the three dimensions correpsonding to glittering and unglittering each of the three nails. The picture below shows how the standard Gray Code solution can be modified to create a minimal-removals, no-glitter to all-glitter, solution, which on the cube corresponds to a path starting and ending at opposite corners.

Switching 1s for 2s and vice versa in the second 121 subection has done the trick here, but for the five-nails case it’s a bit more complex. It’s hard to visualise a trip round a five-dimensional hypercube, so let’s return to the digit sequence. Starting and ending at opposite corners happens if and only if each digit appears in the sequence an odd number of times (an even number of changes puts you back where you started). In the longer five-digit sequence we can still switch 1s and 2s in a 121 subsequence, but we can also switch around the 1s, 2s and 3s in a larger 1213121 subsequence, or even the 1s, 2s, 3s and 4s in one of the two big 121312141213121 chunks. A brief bit of faffing around before too long delivered this sequence:

\[1213121413121315232423212324232\]

where we’ve switched 2s with 3s in the second 1213121 chunk, and changed the 1s to 2s, 2s to 3s, 3s to 4s and the 4 to a 1 in the second 121312141213121 chunk. This sequence of digit-changes contains each digit an odd number of times, and gives the full sequence of nails tabulated above.

Having found this one solution, any equivalent solution made by permuting the five columns of binary digits will also only involve 13 removals; plus there are other tweaks you can make to the ordering using the method above. So, this solution generates hundreds of potential other 13-remove solutions. We’ve not ascertained whether all solutions that take exactly 13 can be found in this way from this one, or whether there are multiple classes out there, but this is pretty satisfying.

As always, CL-P has done his usual trick and built an interactive version of this problem, so you can play around with it for yourself and see if you can find a different solution with 13 removals:

The base of the development is a tool to “semantically enrich” mathematical expressions, inferring information about the meanings of individual elements. This is not an easy job, and has required the development of thousands of pattern-matching rules to identify different notational conventions.

This semantic enrichment is passed directly onto a tool which works with a screen reader to read mathematical expressions aloud; the exploration tool lets you work through an expression piece-by-piece, using the keyboard to navigate.

The auto-collapse extension also makes MathJax behave better in responsive designs where the available width for rendered expressions can change, by intelligently picking break points and collapsing sub-expressions so they fit on smaller screens.

We’ve enabled the accessibility extensions on our site – right-click on the expression below and play with the “collapsible expressions” and “explorer” menus.

\[ c_p\rho \int_{x-\Delta x}^{x+\Delta x} [u(\xi,t+\Delta t)-u(\xi,t-\Delta t)]\, d\xi = c_p\rho\int_{t-\Delta t}^{t+\Delta t}\int_{x-\Delta x}^{x+\Delta x} \frac{\partial u}{\partial\tau}\,d\xi \, d\tau \]

In the future, the accessibility extensions will be included in the standard MathJax configuration, but for now you need to manually load them.

To load the accessibility extensions on your own site, you just need to add a line to your MathJax config script. Here’s a basic configuration:

<script type="text/x-mathjax-config"> MathJax.Ajax.config.path["Contrib"] = "https://cdn.mathjax.org/mathjax/contrib"; MathJax.Hub.Config({ extensions: ["[Contrib]/a11y/accessibility-menu.js"], tex2jax: { inlineMath: [ ['$','$'], ["\\(","\\)"] ], processEscapes: true } }); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML"></script>

When you’re reading a site that has loaded MathJax without the accessibility extensions, you can use this bookmarklet (drag the link to your bookmarks) to add in the extensions.

**More information**, including detailed instructions on how to use the extensions and demos of the new features, is at the MathJax blog.

Puzzlebomb is a monthly puzzle compendium. Issue 54 of Puzzlebomb, for June 2016, can be found here:

Puzzlebomb – Issue 54 – June 2016

The solutions to Issue 54 can be found here:

Puzzlebomb – Issue 54 – June 2016 – Solutions (printer-friendly version)

Previous issues of Puzzlebomb, and their solutions, can be found at Puzzlebomb.co.uk.

]]>The Carnival rounds up maths blog posts from all over the internet, including some from our own Aperiodical. See our Carnival of Mathematics page for more information.

]]>- Prof. Alice Rogers, Emeritus Professor of Mathematics, King’s College, London, appointed OBE for services to Mathematics Education and Higher Education.
- John Sidwell, volunteer, HMP Hewell appointed MBE for services to Prisoners through One to One Maths.
- Danielle George, vice-dean for teaching and learning, Faculty of Engineering and Physical Sciences, University of Manchester, appointed MBE for services to engineering through public engagement.
- Anthony Finkelstein, professor of software systems engineering, University College London and the Alan Turing Institute, for services to computer science and engineering.
- Economist Angus Deaton, professor, Princeton University, Nobel laureate, for services to research in economics and international affairs.
- Prof. Alan Thorpe, lately Director-General of the European Centre for Medium Range Weather Forecasts, appointed OBE for services to environmental science and research (thanks to Philip Browne on Twitter).
- Prof. Nalini Joshi was made an Officer of the Order of Australia (AO); the citation is more involved than the UK ones and reads “for distinguished service to mathematical science and tertiary education as an academic, author and researcher, to professional societies, and as a role model and mentor of young mathematicians” (added in an update 16/06/16).

It’s also worth mentioning the new batch of Regius professorships, 12 posts created at universities around the UK to celebrate the Queen’s 90th birthday: Oxford University has been given a professorship in maths, but no appointment has been made yet.

Are there any others we’ve missed? Please add any of interest in the comments below. A full list may be obtained from the Cabinet Office website.

]]>