| Happy Numbers isn't a new investigation, and it may have other names.
I was first shown Happy Numbers twenty years ago. It works like this: Chains of numbers are made. The first number in the chain is split into individual digits, each digit is squared and the sum of these squares becomes the next number in the sequence, and so the process continues; splitting, squaring and adding. For example, starting with 35 the next number is 34, that's 9 + 25, the number after 34 is 25, followed by 29, 85 and so on. Explore this process for yourself to see what happens. Do numbers just get larger and larger, or is there a limit? Do numbers eventually map back to themselves? |
||
|
Using a spreadsheet for mapping sequences of this kind.
Sometimes a mathematical situation seems to have no particular purpose but, if our curiosity is excited, and our minds become energised, then exploring a situation's possibilities may reveal an interesting structure or lead us to invent a technique that could be useful elsewhere. That is what happened for me with this investigation. I should admit that the Happy Numbers investigation itself has never done much to arouse my curiosity. When I found answers, my response was "OK, now I know. So what?" But the investigation did lead me to try out an Excel function which looked up results I had already calculated, and that was a worthwhile discovery. |
||
|
Putting Excel to work
As always, the main value of the spreadsheet when investigating a mathematical situation, is to give results quickly and easily, so that as much of my attention as possible is available to think about any patterns or connections I notice. When I first explored Happy Numbers I didn't use a spreadsheet. Actually twenty years ago spreadsheets were strange and new to most people. In some ways that was a good thing. Using a computer can frequently become the automatic choice. When we realise we have become automatic in our response to a situation it can often be helpful to pause and try out the options; at least in our imagination. Twenty years ago, in my pre-spreadsheet days, I sat for a bit, thought about the process I was being invited to explore, tried out a few calculations, started recording some results, and so on. I still usually start work this way. After a little while I realised that I was spending too much time calculating and not enough time thinking about what was happening in the process. I did notice that the order of the digits was unimportant, that starting at 35 or 53 was really the same thing apart from the first number. I also invested ten minutes, away from the main task, to made a table of results so that I could at least stop doing all of the individual calculations and record my results faster. I produced the table back then by doing my own calculations, except for the symmetric values of course. Now I would very likely use a spreadsheet for a table of results from a function of two independent variables. Click here to look back at an earlier "Excel @ Mathematics" notes on technique to see how to do this. The table of results also helped in another way. It helped me see that all two-digit numbers mapped onto one- or two-digit numbers, except those that mapped onto 100, 106, 113, 128, 130, 145, or 162, but each of these immediately map back to a two-digit result, so the set has closure. It is also worth pausing to see what happens to numbers with plenty of digits (they always reduce in size), and to understand why that happens. |
||
|
||
| The three-digit number which produces the largest next value is 999, and this maps to 243, so all three-digit numbers map to three-digit numbers until they fall into the two-digit set discussed above.
The four-digit number which produces the largest next value is 9999 which maps to 324, so all four-digit numbers map to numbers with less than four digits. I said earlier that the Happy Numbers problem did make me think about how to use a spreadsheet in a new way: to look up results I had already calculated. Here's how I did that: Happy Numbers with VLOOKUP |
||
|
Although the square table was useful when I had to fill in the answers myself, because it saved me doing separate calculations for both numbers in a pairs like 35 and 53, once a spreadsheet is doing the calculations this saving is not of much value.
Click here to see the Excel file Happy Numbers Click here to see the same Excel file with conditional formatting used to highlight the structure Using Conditional Formatting makes values of interest easier to see. Click here to look back at an earlier month's
Excel @ Mathematics notes on conditional formatting.
|
||