Project

Introduction

In the intersection of discrete and recreational mathematics lies a mysterious structure called "Happy Numbers" and the mutually exclusive "Unhappy Numbers". In relation to these structures, what does it mean to be happy (or unhappy)? In the physical world, one might be considered happy if they were working toward an achievable goal, and one might be unhappy if no matter how hard they work, they keep going in circles. It's the same with these sets of numbers here. In this report, we'll explore some interesting facts and relationships regarding happy and unhappy numbers.

History and Background

The origin of happy numbers as a concept is unclear, but may have been taught in scattered classrooms for a few decades (Guy, 2004). Guy describes its history with a short two sentences:
"[Lecturer at Leeds University] Reg Allenby's daughter came home from school in Britain with the concept of happy numbers. The problem may have originated in Russia."
There are little to no additional sources for its origin or early history. Happy numbers did however experience an explosion of interest after Numberphile's Brady Haran interviews with Hannah Fry and Matt Parker gained popularity on YouTube in the early 2010's. Parker created a graph of (nearly) all the two-digit numbers in base 10 and their structures, and invited viewers to discover relationships using related processes, such as cubing instead of squaring, or using different bases (Numberphile, 2012). The related concept of narcissistic numbers and perfect digital invariants had been studied for much longer (Madachy, 1968, 163-175), and will be addressed in "Extensions" later on.

Explanation of Mathematics

The process of "happification", as we will call it, starts with any integer. We take the squares of each of the digits and sum them together. We then take that new integer and do that ad infinitum, or in practice, until an integer is repeated. For example:
44 →(42+42=)32→(9+4=)13→10→1→1→...
We can then conclude 44 is a happy number. Let's look at a non-example:
6→36→45→41→17→50→25→29→85→89→145 →42→20→4→16→37→58→89→145→...
Exhaustion of all the two-digit numbers (and necessary 3-digit numbers) in base 10 shows that there are two results of happification: either the number goes to 1and is happy, or goes to the 8-number cycle 89 → 145 → 42 → 20 → 4 → 16 → 37 → 58 →89... , and is unhappy. Figure 9 in the "Figures" section displays a directed graph network of this fact, similar to the one done by Matt Parker, mentioned aforehand (Numberphile).
A closer look at Figure 9 brings forward some facts that could be considered trivial. For example: "If d1d2 is happy, then d2d1 is also happy". This is true simply from the commutative property; d12+ d22 and d22+ d12 will both lead to the same string (e.g. 31 and 13 are both happy). Some more are listed below.

Extensions

Figures 1-8 show the graphs for bases lower than 10, exhaustive for two-digit numbers. To explore these we must define perfect digital invariants, which are numbers that equal themselves after applying the following function:
F(p,b)(n) = ∑i=1dip
where n is the integer of interest, p is any positive integer, b is a positive integer base and di are each of the digits of n. Since we are only focusing on squaring the digits, p will only equal 2 for all extents and purposes. For base 10, it has been proven that the only perfect digital invariants (PDI's) are 1 as 12=1 and 0 as 02=0 (Faser, 1973). However, we can see that this can be a more common occurrence in other bases. An example is base 7, there are at least four additional PDI's: 13, 34, 44, and 63:
12 + 32 = 137; 32 + 42 = 9 + 16 = 347; 42 + 42 = 447; 62 + 32 = 637
The amount of PDI's does not appear to be dependent on characteristics of the base b either, such as prime-ness, as base 8 and 9 also have several PDI's. More characteristics of different bases are listed below.

Significance/Applications

The study of happy/unhappy numbers and structures is considered recreational mathematics. The purpose of this type of math is for entertainment, whether by experts in the field, novices, or even small children. Problems in the genre are often in a 'game' or 'challenge' formatthink Sudokuand have arbitrary rules with simplistic mathematical ideas. In the example of happy numbers, we can question "Why do we square the digits? Is there relevance in the cycles beyond aesthetics?", (not to mention the various potential theorems we can come up with, most of them likely unproveable). Whether or not there are direct applications of these structures and processes is largely unknown.
However, this does not make happy numbers or other recreational mathematics topics useless. It has been found that use thereof has had a positive impact on motivation in elementary school students (Anggraeni & Budiharti, 2021). It has also been conjectured that recreational mathematics helps maintain interest in procedures, make cross-curricular links, and promote general problem solving and communication of ideas (Rowlett et al., 2019).

Figures

References

Anggraeni, G., & Budiharti. (2021). Recreational Mathematics Activities to Enhance Students' Mathematics Achievement and Learning Motivation. Journal of Physics: Conference Series, 1823. 10.1088/1742-6596/1823/1/012019 Faser, V. G. (1973, Spring). Narcissistic Numbers. Pi Mu Epsilon Journal, 5(8), 409-414. JSTOR. https://www.jstor.org/stable/24345049 Gilmer, J. (2015). On the Density of Happy Numbers. Arxiv. https://doi.org/10.48550/arXiv.1110.3836 Guy, R. (2004). Unsolved problems in number theory. Springer. Madachy, J. S. (1968). Mathematics on Vacation (1st ed.). Scribner. McCranie, J. (2009, June 20). Smallest unhappy number in base n. The On-Line Encyclopedia of Integer Sequences. Retrieved October 30, 2023, from https://oeis.org/A161872 Numberphile. (2012, February 26). 145 and the Melancoil. YouTube. Retrieved October 27, 2023, from https://www.youtube.com/watch?v=_DpzAvb3Vk4 Rowlett, P., Smith, E., Corner, A. S., O'Sullivan, D., & Waldock, J. (2019, September 5). The potential of recreational mathematics to support the development of mathematical learning. International Journal of Mathematical Education in Science and Technology, 50(7), 972-986. https://doi.org/10.1080/0020739X.2019.1657596

Applets

Applet from t.spillane: Move the "x" to see the process of happification for any number. The x-value is the 10's place. The y-value is the 1's place.

For an activity involving perfect digital invariants, click here .