The private life of numbers (2): from figurate to happy numbers

This is Part 2 of a set of three posts adapted from Mateja Prešern’s talk at The Burn in November 2011.

In Part 1 we looked at the set of “lucky” numbers. Of course, there are many other sets of “interesting” numbers that we could define — Tanya Khovanova’s excellent Number Gossip website lists several dozen. Some of these sets are really just curiosities, while others have a lot of mathematical interest, and even touch on unsolved problems. In this post we’ll look at a few of them…

Figurate numbers

The natural number n is a triangular number if n dots can be assembled into an equilateral triangle:

The first few triangular numbers are 1, 3, 6, 10, 15, 21, 28, 36, … The nth triangular number is given by

T_n = \displaystyle\sum_{k=1}^n k =\displaystyle\frac{n(n+1)}{2} = \binom{n+1}{2}.

(A good exercise for the reader: prove this, by induction or otherwise!)

Similarly, a square number is one that counts the dots in a square. Clearly the nth square number is just n^2. It’s perhaps less obvious that the triangular and square numbers are related: the nth square number is the sum of the nth and (n-1)th triangular numbers. Here’s why:

We wouldn’t be mathematicians, of course, if we didn’t generalise things wherever possible… A polygonal number is any number that counts the number of dots in a regular polygon: there are pentagonal numbers, hexagonal numbers and so on. The notion can also be generalised into three dimensions, giving (for example) the tetrahedral numbers, and still more generally to give the general concept of a figurate number. Finding ways to count these is a good exercise for any budding combinatoricists among you…

Some ominously named numbers

"The Number of the Beast is 666" by William Blake

Vampire numbers. The number n is called a vampire number if there exists a factorization of n using its digits. For example:
126 = 6 \times 21.
1260 = 21 \times 60.
125460 = 204 \times 615 = 246 \times 510.

Evil numbers. The number n is an evil number if it has an even number of 1s in its binary expansion. (If it has an odd number of 1s, it is odious. Sometimes you just can’t win.) For example, 1 = 1_2, 3 = 11_2, 5 = 101_2, 6 = 110_2, 9 = 1001_2, and so on…

There are 4999 evil numbers below 10 000. (How could you work this out without listing them all?)

Apocalyptic powers. The number n is an apocalyptic power if 2^n contains the consecutive digits 666. For example,
2^{157} = 182687704\mathbf{666}362864775460604089535377456991567872.

The first ten apocalyptic powers are: 157; 192; 218; 220; 222; 224; 226; 243; 245; 247.

Happy numbers

After all that, it’s a relief to turn to something more cheerful! Take the sum of the squares of the digits of a natural number n. If iterating this operation eventually leads to 1, then n is a happy number. For example, 23 is happy:

The first few happy numbers are 1, 7, 10, 13, 19, 23, 28, 31, 32, 44, 49, 68, 70…

If d_1d_2...d_k is happy, then so is d_1^2+d_2^2+...+d_k^2. For example,

49 \ \rightarrow \ 4^2+9^2 = 97 \ \rightarrow \ 9^2+7^2 = 130 \ \rightarrow \ 1^2+3^2 = 10 \ \rightarrow \ 1^2 = 1.

If d_1d_2...d_k is happy, then so is any number with the same digits, and any amount of additional zero digits. For example, 167, 176, 617, 671, 716 and 761 are all happy; and so are 1670, 1607, 1067,…

You might have noticed that among the first few happy numbers listed above, the consecutive numbers 31 and 32 appear. A little later on, we find a sequence of three consecutive happy numbers: 1880, 1881, 1882. Further on still, we find 7839, 7840, 7841, 7842. In fact,

Theorem. There exist sequences of consecutive happy numbers of arbitrary length.

The proof is a little too involved to give here, but here’s a link to the paper by El-Sedy and Siksek (2000) that proves it.

The first sequence of five consecutive happy numbers starts at 44488. The first sequence of six consecutive happy numbers happens to be the first sequence of seven consecutive happy numbers, namely, the sequence that begins with 7899999999999959999999996. Happy numbers in the smallest sequence of eight have 159 digits, and we’re not going to list them here! (No sequences of 20 have been found, so that gives you something to do on a rainy afternoon.)

If n is not happy, then the sequence of sums of squares of digits does not go to 1. Such numbers are called — wait for it! — unhappy. It can be shown that the sequence  for unhappy numbers always ends up in the cycle 4, 16, 37, 58, 89, 145, 42, 20. There are infinitely many happy numbers and infinitely many unhappy numbers.

"Don't they teach recreational mathematics any more?"

(By the way, for anybody who doubts whether this sort of thing has practical applications, in the Doctor Who episode 42, the sequence of happy primes 313, 331, 367, 379 is used as a code for unlocking a sealed door on a spaceship about to collide with a sun. So there.)

Coming in Part 3: numbers go beyond happiness and reach perfection…

(MP/DP)

Advertisements
This entry was posted in Articles. Bookmark the permalink.

3 Responses to The private life of numbers (2): from figurate to happy numbers

  1. Pingback: The private life of numbers (3): perfect numbers | Degree of Freedom

  2. len says:

    Hello

    I really liked your blog and I’ll aquiu often in the future.

    on this post, I would ask you, happy numbers can be expressed as recurrence relations, as well as the recursive formulas of the Fibonacci numbers???? Or is that impossible???

    Goodbye and see you soon …

    • strathmaths says:

      Hmm… There certainly can’t be a simple recurrence formula as there is for the Fibonacci numbers, because the property of “happiness” depends on the choice of base — happy numbers in base 7, say, wouldn’t be the same as happy numbers in base 10. Algebraic recurrence relations like that for the Fibonacci numbers, on the other hand, don’t care about the base that’s used.

      This doesn’t mean there isn’t some very sneaky way to construct a recurrence relation that used some property of the base-10 representation of the numbers… all I can say is that I’ve never heard of one and I find it pretty hard to imagine how it could be constructed. But of course that doesn’t prove anything!

      (DP)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s