Loops

"Mathematicians have their own version of stunt flying. They use numbers instead of airplanes. (Wouldn't you know it!) They get their thrills from numerical loopings and from discovering patterns while they're doing their tricks. One person's pattern is another's loop-the-loop."
Math for Smarty Pants
Here are some interesting looping techniques (involving starting with some number and repeating some process on it over and over again) that you might want to try out:

Start with any number you like and follow the following rules:

  1. If your number is even, divide it by two. Otherwise, multiply it by 3, then add 1.
  2. Repeat step 1. And again, and again... that's the looping part.

For example, Start with 10. It's even, so divide by two. That gives you 5. It's odd, so multiply it by 3 and add 1: ( 5 × 3) + 1 = 16. 16 is even, so take half and get 8. Half again gives you 4. Half again gets you to 2, and half again gives you 1. Since 1 is odd, multiply by 3 and add 1 to get 4. Half of 4 gives you 2, and half of that gets you back to 1. You're in a loop now and will be forever if you keep at it.

Here's another example, using 33. You may want to try it yourself to verify that you get the following: 33, 100, 50, 25, 76, 38, 19, 58, 29, 88, 44, 22, 11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1, 4, 2, 1, ...

A calculator might come in handy here.

Have some fun trying some more, but note that some numbers can take a while to loop back. For example, if you were to start with 27, it takes 109 steps! Other time-consuming yet small numbers are 31, 41, 47, 55, 62, 63, 71, and 73. Of course, any of these numbers multiplied by two or four (or any other power of two) will give you a long sequence too.

You might wonder whether every integer will eventually loop into this 4-2-1 pattern at the end. I have personally tested this for every number up to 1,000,000 (with a computer program, of course), and every number falls into that loop. Others have tested this conjecture to much higher numbers. Naturally, checking every number doesn't satisfy mathematicians, as it will never answer the question of whether every number will eventually loop into the pattern. This is known as the Collatz conjecture, the idea that every number does. While it seems likely to be true, proving it to be either true or false is quite difficult. No-one has found a number that doesn't work, but no-one has been able to prove that every number works.

Here's another looping procedure somewhat similar to the previous one. This one was developed by Clifford Pickover, who calls it the Juggler Sequence. The difference between this sequence and the loop described above is that, to get the next number, you take the square root of the current number if it is even, and multiply by the square root of the current number if it is odd. Most sequences end . . ., 6, 2, 1. Some never seem to end, though. You might want to try a few numbers.

Another looping procedure is known as aliquot chains. For this procedure, start with any natural number. Find the sum of its proper divisors (also known as aliquot parts). Now take the sum, find the sum of its aliquot parts, and so on and so on.

This loop behaves in a variety of ways. For some numbers, such as 6 and 28, the sum of their aliquot parts is equal to themselves; these are known as perfect numbers. Other numbers loop back to themselves after two (for amicable numbers) or more (for sociable numbers) iterations. Many numbers reach 1 eventually (if you start with a prime number to begin with, you'll get there really quickly).

For the next looping procedure, start with any two numbers from 0 to 9 and follow this rule: Add the two numbers and write down just the digit that is in the ones place. Here's an example: Suppose you start with 8 and 9. Adding them gives you 17. Keep just the 7, which is in the ones place. Add the last two numbers, the 9 and the 7. That gives 16; keep the 6, then you have 8-9-7-6. Keep going, adding the last two numbers in the series each time, keeping only the digit in the ones place. Do this until you get 8 and 9 again. Then the loop starts all over. The 8-9 pattern has twelve numbers in the loop before it repeats. The pattern is: 8-9-7-6-3-9-2-1-3-4-7-1-8-9.

If going around in a numerical circle appeals to you, you may have the makings of a terrific mathematician. Hang in there. But beware. If you start with the same two numbers, but in the opposite order, and follow the same rule: 9-8-7-5, and so on, it will take 60 numbers before it starts to repeat! Don't tackle that one unless you're sure you have the time. For a quickie, try 2 and 6.

Here's some questions you might want to think about:

  1. How many different possible pairs of numbers are there to start with? (It's okay to start with two numbers that are the same).
  2. Do all pairs of numbers eventually return to the starting point?
  3. What's the shortest loop you can find?
  4. Is there a pattern of odds and evens in the loop?

Here is a numerical example using words. Start with any number (in the example below, 39). Write it as a word: thirty-nine. Then continue as shown.

Start with any number 39
Write it as a word thirty-nine
Count the letters 10
Write that as a word ten
Count the letters 3
Write that as a word three
Count the letters 5
Write that as a word five
Count the letters 4
Write that as a word four
Count the letters 4

You'll get 4 forever and ever. In fact, you will always end up with 4, no matter what number you start with originally. Try a different number and see. Convince yourself with some examples, then see if you can figure out why you'll always get to four. A good starting point would be to look at how to write out big numbers. You may also want to determine what the result would be in other languages.

If you're interested in looping, you may want to check out the sections on palindromes, sociable numbers, and also the section on chaos.


Last updated April 22, 2011. URL: http://mathlair.allfunandgames.ca/loops.php For questions or comments mathlair@allfunandgames.ca. Math Lair home page Visit All Fun and Games