Happy Numbers – by hand and programming

Thanks to nrich for the following puzzle:

Have you met Happy Numbers? Start with any number you like and form a sequence by writing down the sum of the squares of the digits of each number to get the next number in the sequence. For example, from 31 you go to 10 because 3 squared plus 1 squared makes 10. Here is a ‘happy’ sequence:

31 -> 10 -> 1 -> 1 -> 1 … Smiley Face

Numbers are called ‘happy’ when their sequences, sooner or later, give repeated 1’s. We say 1 is a fixed point.

25 -> 29 -> 85 -> 89 -> 145 -> 42 -> 20 -> 4 -> 16 -> 37 -> 58 -> 89 ->…

The number 25 is sad because, however long we go on with the sequence, it will never come to 1, it will just keep repeating the terms (89, 145, 42, 20, 4, 16, 37, 58) over and over again. We call this an 8-cycle or loop. Can you find some more happy numbers?

Can you use excel or python to find more?

Graph Theory

We were delighted to welcome ex Lycee student Al Sergeevo back to Maths Club. He did a fantastic interactive presentation on graph theory culminating in using Euler’s formula to derive the number of faces on a dodecahedron.

Thanks to Mr Boswell for taking these notes to share.

Al left us with the puzzle – Given that a football is made up of hexagons and pentagons, how many faces does it have?

Humble-Nishiyama Randomness Game revisited

We played a two player strategy game today, using all the information from +plus magazine.

The game is played as follows. At the start of a game each player decides on their three colour sequence for the whole game. The cards are then turned over one at a time and placed in a line, until one of the chosen triples appears. The winning player takes the upturned cards, having won that “trick”. The game continues with the rest of the unused cards, with players collecting tricks as their triples come up, until all the cards in the pack have been used. The winner of the game is the player that has won the most tricks. An average game will consist of around 7 “tricks”.

e.g. Player 1 picks RRB, Player 2 picks RBB and see who wins.

The question we thought about was:

  • Is it just a game of chance, or if you are choosing second, could you improve your chance of winning?

There is a related game called Penny’s game, using Heads and Tails of a coin toss instead of playing cards. In this version, you just play until one person has won a “trick”. We worked out some of the odds given in the first table in this article.

We ended up having to sum a geometric series! Great fun!

Name that polynomial … revisited

This game is thanks to David Bedford at the BCME Conference in Warwick.

One person writes down a polynomial with positive integer coefficients. Call it f(x) They then choose an integer that it bigger than all their coefficients. Call it n. They then calculate f(n) and give just n and f(n) to the second person.

The second person should be able to name that polynomial! How?

Example:

Given only n=8 and f(n) = 6855 how could you work out that the polynomial was

?

It might help to think about an example when n=10 first.

Here is a cheatsheet for when you have a strategy. Can you write some Python code to work out the polynomial for you?

Lights Out

Lights Out was an electronic game released by Tiger Electronics in 1995. The game consists of a 5 by 5 grid of lights. When the game starts, a random number or a stored pattern of these lights is switched on. Pressing any of the lights will toggle it and the adjacent lights. The goal of the puzzle is to switch all the lights off, preferably with as few button presses as possible.

Here, or below, you can play a 3 x 3 version on Geogebra (courtesy of Stephen Jull and Yin Su).

One method to solve – Light Chasing

“Light chasing” is a method similar to Gaussian elimination which always solves the puzzle (if a solution exists), although with the possibility of many redundant steps. In this approach, rows are manipulated one at a time starting with the top row. All the lights are disabled in the row by toggling the adjacent lights in the row directly below. The same method is then used on the consecutive rows up to the last one. The last row is solved separately, depending on its active lights.

Here is a worksheet showing all the possibilities (effectively) for the last row. Can you solve them all, and hence solve any 3×3 grid?

Here are links to play the 4×4 game and the 5×5 game.

Queen and Pawn Puzzles

One of our favourite chess puzzles …

Place 8 queens on a chessboard such that none of the queens can take any of the others. Above is a fail – only 5 queens are on the board and they are no places left to put any more.

Here is a website to try yourself to fit 8 queens on the board, it is possible!

We then looked at changing the size of the board from an 8 by 8 to smaller sizes, e.g. can you fit 5 queens on a 5 by 5 board? And if so, how many “unique” solutions are there? We defined a unique solution as being one that did not look like any others we had found when we rotated our paper or put it up to the light so it appeared flipped! Here are our solutions for 5×5, 6×6 and 8×8.

There is a great numberphile video  on this puzzle, and all the answers and stats you could want here.

And finally this great puzzle from Alex Bellos in the Guardian

Can you find a path in which the queen captures all 11 pawns in exactly 11 moves? (The pawns do not move or protect each other.)

Sudoku

Can you create a sudoku?

Think about

  • What would be an efficient way to create a puzzle?
  • How difficult would you like it to be?
  • What is the maximum number of 3×3 squares you could remove and it still be solvable? Does it matter which squares?
  • Could you design it so that it could be easily transformed into mutliple versions? How many versions could be created from your one puzzle?

Here is a fascinating article on how one website generates their sudokus and a paper proving the minimum number of clues needed.

Card game – mod 8!

We played a game posted on youtube by Mr Allen.

Here are his instructions:

This is a card game I made up where you do basic mental calculations and race your opponent ( 2-4 players). Using Ace -10 cards only. Rules: 7 cards are placed face up for each player and two in the middle. The player who gets rid of their cards first wins. You can put a card in the middle (on top of either pile) when one of your cards is an answer to an expression using the two cards in the middle. eg. if 6 and 2 are in the middle possible cards that can be played are 8 (6+2) or 4 (6-2) or 3 (6 divided by 2) or 2 (6×2) – 12 is the answer but we use the last digit only. Each player has to say the expression as they put the card down. eg 6 twos are 12 – placing the 2. or 6 minus/take/sub 2 is 4. all players play on until no cards can be played. Then the dealer deals each player a card then put one on one of the two middle piles. Players then race to place cards until someone gets rid of all their cards! (4 players start with 6 cards)

We played a few games of this and made up our own versions:

  1. Instead of a race we played in turn – competitively or collaboratively
  2. We removed the 9s and 10s and played in mod 8

Cereal Box Problem

Suppose there was one of six toy animals inside your favorite box of cereal and you would like to collect them all.

You could be lucky and only buy six boxes, but how many boxes of cereal would you expect to have to buy on average?

With thanks to this website we carried out an experiment with dice to simulate this problem:

Click here for a pdf with several blank tables to cut out and use.

We then used python to generate 1000 trials and compared our average to the theoretical average we calculated.