6. Other magical numbers

Fibonacci numbers and the golden ratio are not the only places where simple rules produce astonishing behaviour. This final lesson is a mathematical playground.

Triangular numbers

Some numbers have a shape. The sequence

1, 3, 6, 10, 15, 21, …

is called the sequence of triangular numbers, because these numbers of dots can be arranged into triangles.

1
3
6
10

Build them one row at a time

Each new triangle is made by adding a new row of dots:

1
1 + 2 = 3
1 + 2 + 3 = 6
1 + 2 + 3 + 4 = 10
1 + 2 + 3 + 4 + 5 = 15

So the n-th triangular number is the sum of the first n counting numbers:

Tn = 1 + 2 + 3 + ··· + n

A visual shortcut

Take two copies of the same triangular arrangement. Turn one around and fit them together. They make a rectangle with n rows and n + 1 dots in each pair of rows.

one triangle
1 + 2 + ··· + n
+
a second copy
n + ··· + 2 + 1
together they form n(n + 1) dots
Tn = n(n + 1) ÷ 2
Try it
The 8th triangular number

Use either the sum 1 + 2 + ··· + 8 or the shortcut 8 × 9 ÷ 2.

Reveal answer

8 × 9 ÷ 2 = 36.

Why do triangular numbers appear in counting?

Imagine a group of 6 people and count every possible pair. The first person can pair with 5 others, the next has 4 new partners left, then 3, then 2, then 1:

5 + 4 + 3 + 2 + 1 = 15

So choosing a pair from 6 objects gives the 5th triangular number. In general, choosing 2 objects from n objects produces a triangular number.

Connection

This is why triangular numbers appear as a diagonal in Counting & Combinatorics: Pascal’s triangle →.

Kaprekar’s constant: 6174

Choose almost any four-digit number whose digits are not all the same. Rearrange its digits from largest to smallest and from smallest to largest, then subtract the smaller number from the larger. Repeat.

Example
Start with 3524

5432 − 2345 = 3087
8730 − 0378 = 8352
8532 − 2358 = 6174
7641 − 1467 = 6174

6174 is the special four-digit case. But what happens if we keep exactly the same rearrange-and-subtract rule and start with a different number of digits? Try it below and see whether the process settles at a fixed number or falls into a repeating cycle.

Interactive investigation
Try the Kaprekar process with your own number

Enter a number with 2 to 8 digits and at least two different digits. The animation will keep rearranging and subtracting until it reaches a fixed point or enters a repeating cycle.

Special cases: three-digit numbers usually settle at 495, while four-digit numbers settle at 6174.

Try:
💡
Learning tipThe number of digits stays fixed during the process. If a result is shorter, add leading zeroes. For example, with a four-digit start, 378 becomes 0378.
Kaprekar challenge
Can you control the number of steps?

Can you find a starting number that reaches 6174 in exactly 1 step? What about 2 steps? 3 steps?

Make a conjecture: do you think every possible step count occurs?

Reveal one easy starting point

To reach 6174 in one step, you need a number whose descending digits minus ascending digits equals 6174. For example, 7641 works immediately because 7641 − 1467 = 6174.

The 1089 trick

Here is another number trick built from nothing more than reversing digits and subtracting. Unlike 6174, this one starts with a three-digit number.

The rule
Reverse, subtract, reverse, add
  1. Choose a three-digit number whose first and last digits differ by at least 2.
  2. Reverse its digits.
  3. Subtract the smaller number from the larger.
  4. Reverse that answer, keeping leading zeroes if needed.
  5. Add the two numbers.
Try it
Can you predict the final answer?

Start with 532:

532 − 235 = 297
297 + 792 = ?

Reveal the result

297 + 792 = 1089.

Now try a few different starting numbers. Does the same total keep appearing?

💡
Learning tipIf the subtraction gives a two-digit answer, write a leading zero before reversing it. For example, 99 becomes 099.
Why might this happen?
Look at the place values

Suppose your three-digit number is written as 100a + 10b + c. Its reverse is 100c + 10b + a.

What happens when you subtract them? Notice that the middle digit disappears completely.

Can you use that observation to explain why the trick always ends at 1089?

Reveal the key idea

The difference is

(100a + 10b + c) − (100c + 10b + a) = 99(a − c).

So the middle digit never matters. The whole trick depends only on the difference between the first and last digits. Reversing and adding the result then produces 1089.

Perfect numbers

The word perfect has a special meaning in mathematics. It does not mean that the number is somehow better than other numbers. It describes a surprising relationship between a number and its divisors.

First: what is a divisor?

A divisor of a number divides into it exactly, with no remainder.

For example, the divisors of 6 are:

1   ·   2   ·   3   ·   6

For perfect numbers we leave out the number itself. These are called its proper divisors. So the proper divisors of 6 are 1, 2 and 3.

Why is 6 perfect?

Now add those proper divisors:

1 + 2 + 3 = 6

They add up to the original number exactly. That is why 6 is a perfect number.

Try the same idea with 8

The proper divisors of 8 are 1, 2 and 4.

1 + 2 + 4 = 7

The sum is 7, not 8, so 8 is not perfect. Most numbers are not.

The next perfect number: 28

Finding all the proper divisors takes a little longer. It helps to look for factor pairs:

1 × 28 gives divisors 1 and 28.

2 × 14 gives divisors 2 and 14.

4 × 7 gives divisors 4 and 7.

Leave out 28 itself. The proper divisors are therefore

1, 2, 4, 7, 14

1 + 2 + 4 + 7 + 14 = 28

Again, the proper divisors add up exactly to the number. So 28 is perfect too.

The pattern so far

6 is perfect. 28 is perfect. Then there is a surprisingly large jump: the next two are 496 and 8128. Perfect numbers become rare very quickly.

💡
Learning tipWhen searching for divisors, work in factor pairs. Once the smaller factor passes the square root of the number, you have already found the matching partners.
Pause and think
What has to happen for a number to be perfect?

It is not enough to have lots of divisors. Their values have to balance in exactly the right way so that their sum lands back on the original number.

Can you find a number smaller than 28, other than 6, whose proper divisors add up to itself?

Advanced fact: where do perfect numbers come from?

There is a beautiful connection with special prime numbers called Mersenne primes.

If 2p − 1 is prime, then

2p−1(2p − 1)

is a perfect number.

For example, p = 2 gives 2 × 3 = 6, and p = 3 gives 4 × 7 = 28.

Every even perfect number has this form. Mathematicians still do not know whether any odd perfect numbers exist.

Divisor hunt
Which of these are perfect?

Find the proper divisors of 6, 12, 20 and 28. Add them up. Which numbers equal the sum of their own proper divisors?

Reveal answer

6: 1 + 2 + 3 = 6 — perfect.

12: 1 + 2 + 3 + 4 + 6 = 16 — not perfect.

20: 1 + 2 + 4 + 5 + 10 = 22 — not perfect.

28: 1 + 2 + 4 + 7 + 14 = 28 — perfect.

Challenge
Check 496

Find all the proper divisors of 496 and verify that they sum to 496.

Reveal answer

The proper divisors are 1, 2, 4, 8, 16, 31, 62, 124 and 248.

Their sum is 496.

Two giants: π and e

π ≈ 3.14159 begins with circles but appears throughout geometry, probability and infinite sums.

e ≈ 2.71828 appears naturally in continuous growth and can be approached by the expression (1 + 1/n)ⁿ as n gets larger.

Experiment
Watch e emerge

Use a calculator to evaluate (1 + 1/n)ⁿ for these values of n:

n = 1, 2, 5, 10, 100

What number do the results seem to approach?

Reveal values

n = 1 → 2

n = 2 → 2.25

n = 5 → about 2.488

n = 10 → about 2.594

n = 100 → about 2.705. The values creep towards e ≈ 2.71828.

Later mathematics brings them together with the imaginary number i in one of the most famous equations in mathematics:

Famous equation
eiπ + 1 = 0

You do not need to understand this equation yet. It is simply a glimpse of how ideas that first seem unrelated can eventually turn out to be connected.

What makes a number feel magical?

Usually not the number by itself. The magic comes from a simple definition producing unexpectedly rich connections.

  • 6174 emerges from a simple digit algorithm.
  • 1089 appears from a reverse–subtract–reverse–add process.
  • Perfect numbers are defined by the sum of their proper divisors and connect to special prime numbers.
  • π and e begin in very different problems but appear throughout mathematics.

The best next question is not “what other magic numbers are there?” but “what simple rule can I experiment with next?”

Course challenge

Choose your investigation

Pick one idea from this course and investigate it further. You might test how quickly Fibonacci ratios approach φ, search for other cyclic decimals, record how many Kaprekar steps different starting numbers take, or hunt for patterns among perfect numbers.

Make a conjecture, test it, and try to explain why it might be true.

Magical Numbers Lesson 6 – Other Magical Numbers printable maths handout
Printable resources

Lesson 6: Other Magical Numbers

Download the Lesson 6 printable handout to explore 6174, the 1089 trick, perfect numbers and the reasoning behind surprising numerical patterns.

Get the Lesson 6 resources →
Help us improve

What did you think?

Whether you explored this together or worked independently, we would love to hear from both learners and parents. Tell us what you enjoyed, what was confusing, or what you would like to see next.

Share your feedback

The form is short and you do not need to give your name.