# Why does this property hold for odd integers except for 5?

In working on a game I noticed that if I were to take the first ten multiples of seven and consider the last digit of those numbers, the result was exactly one occurrence of each unique digit, zero through nine:

 1 × 7 = 7   =>  7
2 × 7 = 14  =>  4
3 × 7 = 21  =>  1
4 × 7 = 28  =>  8
5 × 7 = 35  =>  5
6 × 7 = 42  =>  2
7 × 7 = 49  =>  9
8 × 7 = 56  =>  6
9 × 7 = 63  =>  3
10 × 7 = 70 =>  0


This struck me as surprising (I'm not a mathematician), so I tried the same thing with all of the other numbers and found the same was true for all of the odd single-digit numbers except for 5.

Why does this property exist? Is there a name for this? What is special about 5 that causes it to not have this property?

• Believe it or not, the reason is that $2\times5=10$. – Yves Daoust Dec 14 '18 at 20:24
• See this Theorem. (put $\,d = 0\,$ there) – Bill Dubuque Dec 14 '18 at 20:24
• You might want to check $4$ and $6$ and $8$ again. This will only work for numbers that are relatively prime to $10$, so no factors of $2$ or $5$ would be allowed. – B. Goddard Dec 14 '18 at 20:25
• @Downvoters Please remember that this is a site for mathematics at all levels. – Bill Dubuque Dec 14 '18 at 20:51
• @BillDubuque I agree, and I do feel that downvoting beginners' clearly expressed (and often interesting) questions is an abuse of the voting system. Someone is interested and curious enough to ask! Someone else might be curious enough to google it, and arrive on this page. If the question is here and answered, the site is doing its job. – timtfj Dec 15 '18 at 1:07

Taking the last digit is the same as dividing by $$10$$ and taking the remainder.

If we call the expression $$a \equiv_n b$$ to mean $$a$$ and $$b$$ both have the same remainder when divided by $$n$$, we can notice that if $$a \equiv_n a'$$ and $$b \equiv_n b'$$ then $$ab \equiv_n a'b'$$ and $$a + b \equiv_n a' + b'$$. (For example: the last digit of $$3,456\times 7,482$$ is the same as the last digit of $$6 \times 2$$. Same thing if you do addition.)

If you start with $$a \times 1$$ and $$a \times 2$$ and $$a\times 3$$ eventually you will get a point where $$a \times k$$ is a multiple of $$n$$. (After all $$a\times n$$ is a multiple of $$n$$ but you may reach it earlier.)

When you get $$a \times k$$ is a mutliple of $$n$$ then you have $$a\times k \equiv_n 0$$ as the remainder is $$0$$. And then $$a\times (k+1) \equiv_n a$$ and the whole thing repeats in an infinite loop.

So...... You will always get a repeaiting infinite loop. The question is when will the infinite loop contain all values and we only some?

Well, if $$a\times k = N$$ and $$N$$ is the least common multiple of $$a$$ and $$n$$ you will get a loop of $$k$$ different values. Now if $$a$$ and $$n$$ are relatively prime--- that means they have no other common factors other than $$1$$--- then the least common multiple is $$a \times n = an$$ and your loop contains all values.

So for any odd number other than a multiple of $$5$$ you get an loop of length $$10$$ with all digits.

On the other hand if $$a$$ and $$n$$ have a greatest common divisor $$> 1$$, then you will have an infinite loop but it will only contain multiple of the greatest common divisors.

So for instance if you do $$5$$ it will contain the multiples of $$5$$. $$5,0,5,0,.....etc.$$ If you do and even number such as $$6$$ you will get all the multiples of $$\gcd(6,10) = 2$$. $$6,2,8,4,0,6,2,8,4,0,.... etc.$$

If you want to play with this, replace "10" by any number $$n$$ and replace "last digit" with "remainder under division by $$n$$". You will find that this works whenever you take multiples of a number $$\{0,2,3,...,n-1\}$$ that has no common factor with $$n$$. It always works when $$n$$ is prime.

For example, take $$4k$$ for $$k=0,\ldots 12$$, and take the remainders under division by 13.

A neat example are the multiples of 7, and their remainders under division by 12: You'll get all numbers from 0 to 11 in order. Try the multiples of 3, 4, or 6, and it won't work.

• So can we answer the question this way? The property is called relative primeness. It works for 1, 3, 7, and 9 because they are relative primes of 10, whereas 5 is not. – Dan Dec 17 '18 at 17:31
• It's a consequence of relative primeness. Relative primeness is that $7$ and $10$ have no integer factors other that $1$ in common. Because of this that have the property you want. Which I'm not sure has a name. It can be described as: the remainders (when divided by $10$) of consecutive multiples of $7$ cycle. If the numbers are relatively prime they cycle through all values. Otherwise they cycle through multiple of the greatest common divisor. – fleablood Dec 17 '18 at 18:03