# why is number 5 unique

**URL:** <https://boards.straightdope.com/t/why-is-number-5-unique/139831>\
**Category:** Factual Questions\
**Created:** [December 1, 2002, 9:37pm UTC](https://boards.straightdope.com/t/why-is-number-5-unique/139831 "2002-12-01T21:37:33Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![rampisad](https://avatars.discourse-cdn.com/v4/letter/r/858c86/32.png) [@rampisad](https://boards.straightdope.com/u/rampisad)\
**Post date:** [December 1, 2002, 9:37pm UTC](https://boards.straightdope.com/t/why-is-number-5-unique/139831/1 "2002-12-01T21:37:33Z")

</div>

Of all the prime numbers (numbers that are not divisible by any other whole number except 1), 5 has a unique property, and I wonder if there’s a reason.

All the other primes (here’s a pointer to a site that gives you 30K of them … [http://www.newdream.net/~sage/old/numbers/primeodd.htm](http://www.newdream.net/~sage/old/numbers/primeodd.htm)) share a common feature. For any prime number n, the reciprocal of the number (1/n) will never compute exactly, will always present a repeating pattern, and the pattern will repeat in (n-1) digits.

Example - prime number 7. Reciprocal is 0.142857 142857 142857 …  
Example - prime number 11. Reciprocal is 0.09090909 0909090909 0909090909  
Example - prime number 29. Reciprocal is 0.0344827586206896551724137931 0344827586206896551724137931 0344827586206896551724137931

However, the reciprocal of 5 is 0.2. It doesn’t repeat.

Any ideas why.

---

<div class="post-metadata">

**Author:** ![Saltire](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/saltire/32/553_2.png) [@Saltire](https://boards.straightdope.com/u/Saltire)\
**Post date:** [December 1, 2002, 9:44pm UTC](https://boards.straightdope.com/t/why-is-number-5-unique/139831/2 "2002-12-01T21:44:10Z")

</div>

I would think that it’s because it is a factor of the number system’s base (10). I wonder if the reciprocal of 7 comes out exact in base-14 math. I wish I wasn’t suffering from Sunday morning brain, or I’d look into it.

By the way, your shared property breaks slightly with 3, since it’s reciprocal’s decimal representation repeats in 1 digit, not 2.

---

<div class="post-metadata">

**Author:** ![Saltire](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/saltire/32/553_2.png) [@Saltire](https://boards.straightdope.com/u/Saltire)\
**Post date:** [December 1, 2002, 9:46pm UTC](https://boards.straightdope.com/t/why-is-number-5-unique/139831/3 "2002-12-01T21:46:00Z")

</div>

Ignore that last sentence. I see from your 11 example that I was interpreting things too strictly.

---

<div class="post-metadata">

**Author:** ![Saltire](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/saltire/32/553_2.png) [@Saltire](https://boards.straightdope.com/u/Saltire)\
**Post date:** [December 1, 2002, 9:49pm UTC](https://boards.straightdope.com/t/why-is-number-5-unique/139831/4 "2002-12-01T21:49:31Z")

</div>

One more comment on my conjecture: 10’s other prime factor, 2, also has an exact reciprocal. That’s got to be important, though my synapses can’t make the leap right now.

---

<div class="post-metadata">

**Author:** ![Winsling](https://avatars.discourse-cdn.com/v4/letter/w/8e8cbc/32.png) [@Winsling](https://boards.straightdope.com/u/Winsling)\
**Post date:** [December 1, 2002, 10:18pm UTC](https://boards.straightdope.com/t/why-is-number-5-unique/139831/5 "2002-12-01T22:18:29Z")

</div>

Saltire’s on the right track. For a number n’s reciprocal to be terminating, it has to be exactly represented in k digits.  
1/n = a/10^k - Assuming it terminates, n is prime, a and k are both integers  
10^k = a \* n - Multiplying both sides by n \* 10^k  
Now if we look at the prime factorization of both sides, the left is all 2 and 5, while the right has at least one more factor, n. As long as n isn’t 2 or 5, that equality can’t be satisfied by integers.

So I’ll generalize and say that a prime’s reciprocal will terminate if you represent it in a base where the prime is a factor.

Your other observation, that the representation repeats in n-1 digits, I haven’t worked through. I’ll think on it.

Hal

---

<div class="post-metadata">

**Author:** ![KellyM](https://avatars.discourse-cdn.com/v4/letter/k/57b2e6/32.png) [@KellyM](https://boards.straightdope.com/u/KellyM)\
**Post date:** [December 1, 2002, 11:00pm UTC](https://boards.straightdope.com/t/why-is-number-5-unique/139831/6 "2002-12-01T23:00:55Z")

</div>

It is, in fact, the case that the representation of _1/n_ in base _b_ is terminating if and only if _n_ can be expressed solely as the product of factors of _b_. In addition, it is also true that the representation of _1/n_ always repeats within (at most) _n-1_ digits. I’ve seen proofs of both of these, but not in years.

The property you noticed has nothing at all to do with primality; it is a consequence of place-value notation in base 10.

The fact that only reciprocals of powers of two have exact binary representations is important in numerical computation, by the way.

---

<div class="post-metadata">

**Author:** ![yabob](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/yabob/32/2821_2.png) [@yabob](https://boards.straightdope.com/u/yabob)\
**Post date:** [December 1, 2002, 11:19pm UTC](https://boards.straightdope.com/t/why-is-number-5-unique/139831/7 "2002-12-01T23:19:03Z")

</div>

As for the repeating, think about performing long division to calculate the representation of any rational, p/q. There are only q-1 non-zero remainders possible, and as soon as you repeat a remainder, you repeat the pattern.

---

<div class="post-metadata">

**Author:** ![ultrafilter](https://avatars.discourse-cdn.com/v4/letter/u/3d9bf3/32.png) [@ultrafilter](https://boards.straightdope.com/u/ultrafilter)\
**Post date:** [December 2, 2002, 1:22am UTC](https://boards.straightdope.com/t/why-is-number-5-unique/139831/8 "2002-12-02T01:22:32Z")

</div>

[Last](http://boards.straightdope.com/sdmb/showthread.php?s=&threadid=131558) [time](http://boards.straightdope.com/sdmb/showthread.php?s=&threadid=131682).

---

<div class="post-metadata">

**Author:** ![yabob](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/yabob/32/2821_2.png) [@yabob](https://boards.straightdope.com/u/yabob)\
**Post date:** [December 2, 2002, 1:38am UTC](https://boards.straightdope.com/t/why-is-number-5-unique/139831/9 "2002-12-02T01:38:52Z")

</div>

Well, it bears, er, repeating …

---

<div class="post-metadata">

**Author:** ![rampisad](https://avatars.discourse-cdn.com/v4/letter/r/858c86/32.png) [@rampisad](https://boards.straightdope.com/u/rampisad)\
**Post date:** [December 2, 2002, 7:39am UTC](https://boards.straightdope.com/t/why-is-number-5-unique/139831/10 "2002-12-02T07:39:23Z")

</div>

I confess I had an idea about the influence of working in a Base-10 system, but I was afraid of making even more of an arse of myself than already in asking the question.

I’m fascinated by **KellyM** ’s statement

> [@](#):
>
> The fact that only reciprocals of powers of two have exact binary representations is important in numerical computation, by the way.

Taking that to it’s logical conclusion, would reciprocals of powers of five also have exact quintenary representations. Does this mean …

1. That one day (given the coming of a modern-day Boole to create the logic in base 5) all (binary based) computers would become suddenly redundant, and
2. This is actually the secret project Bill Gates is working on since retiring as CEO of MicroSoft.

---

<div class="post-metadata">

**Author:** ![Keeve](https://avatars.discourse-cdn.com/v4/letter/k/f07891/32.png) [@Keeve](https://boards.straightdope.com/u/Keeve)\
**Post date:** [December 2, 2002, 1:22pm UTC](https://boards.straightdope.com/t/why-is-number-5-unique/139831/11 "2002-12-02T13:22:07Z")

</div>

A related point:

Just like a reciprocal will be terminating if it is a factor of the base of the number system (i.e., 2 and 5 in base 10, or 2 3 4 and 6 in base 12), so too:

The rule that for any multiple of 9, the total of its digits will also be a multiple of 9, also results from 9’s position in the base-10 system. In other words, the rule holds true for other bases, for whatever is one less than the base. Example: In base eleven, the number nine hundred is represented by 749 [=(7_121)+(4_11)+(9\*1)], whose digits add to twenty, which is divisible by ten.

---

<div class="post-metadata">

**Author:** ![ultrafilter](https://avatars.discourse-cdn.com/v4/letter/u/3d9bf3/32.png) [@ultrafilter](https://boards.straightdope.com/u/ultrafilter)\
**Post date:** [December 2, 2002, 3:30pm UTC](https://boards.straightdope.com/t/why-is-number-5-unique/139831/12 "2002-12-02T15:30:17Z")

</div>

> [@](#):
>
> \*Originally posted by rampisad \*  
> \*\*I’m fascinated by **KellyM** ’s statement
> 
> > [@](#):
> >
> > The fact that only reciprocals of powers of two have exact binary representations is important in numerical computation, by the way.
> 
> Taking that to it’s logical conclusion, would reciprocals of powers of five also have exact quintenary representations. Does this mean …
> 
> 1. That one day (given the coming of a modern-day Boole to create the logic in base 5) all (binary based) computers would become suddenly redundant, and
> 2. This is actually the secret project Bill Gates is working on since retiring as CEO of MicroSoft. \*\*

Nah. There are good reasons why base two won’t become obsolete as long as electronic computers are used.

**KellyM** was alluding to the fact that a large part of floating point error is due to the fact that in binary, unless you’re working with reciprocals of powers of two (or their multiples), you’ll have rounding error because the number won’t have a terminating representation. For instance, if you ask a computer to add together .1 and .1, it’ll say .2, but that’s not the exact value it’s storing.

---

<div class="post-metadata">

**Author:** ![twelfthsign](https://avatars.discourse-cdn.com/v4/letter/t/ce73a5/32.png) [@twelfthsign](https://boards.straightdope.com/u/twelfthsign)\
**Post date:** [December 2, 2002, 4:48pm UTC](https://boards.straightdope.com/t/why-is-number-5-unique/139831/13 "2002-12-02T16:48:37Z")

</div>

You know I’ve often wondered the same. My coach actually gave me a choice to pick a number for my soccer jersey, and I chose 5.  
(oh well, 10 was taken :)) and 5 isn’t my favourite number, nor do I associate it as lucky (although it didn’t proove to be either), but well yea, I’ve known others too, who have an inclination or fetish for 5.

---

<div class="post-metadata">

**Author:** ![Shade](https://avatars.discourse-cdn.com/v4/letter/s/2bfe46/32.png) [@Shade](https://boards.straightdope.com/u/Shade)\
**Post date:** [December 2, 2002, 8:26pm UTC](https://boards.straightdope.com/t/why-is-number-5-unique/139831/14 "2002-12-02T20:26:50Z")

</div>

Surely **the decimal expansion always repeats** for any fraction?

Use long division to divide 1 by any number n. At each stage you are finding the greatest multiple of n less than some number, which is at most 10n, since it’s the previous remainder (\<n) with a naught on the end. There are only so many such numbers, so eventually you’ll get have used the same one twice. Then the same sequence of remainders follows and hence the decimcal expansion repeats. Of course, if you get to remainder 0, you stop, since you know all further remainders will be 0; we can treat 0.2 ad 0.2000…

Same thing should work for any base.

In base 10 **2 and 5 (and any multiples of only 2s and 5s) terminate** because they divide 10. Similarly for any other base (eg. 2,3,6,4,9,etc terminate base 6).

---

<div class="post-metadata">

**Author:** ![rampisad](https://avatars.discourse-cdn.com/v4/letter/r/858c86/32.png) [@rampisad](https://boards.straightdope.com/u/rampisad)\
**Post date:** [December 3, 2002, 6:31am UTC](https://boards.straightdope.com/t/why-is-number-5-unique/139831/15 "2002-12-03T06:31:55Z")

</div>

I think there’s a fundamental difference between **repeating** (which happens for primes) and **recurring**. An example of a recurring fraction would be 1/12 = 0.0833333\*

---

<div class="post-metadata">

**Author:** ![ultrafilter](https://avatars.discourse-cdn.com/v4/letter/u/3d9bf3/32.png) [@ultrafilter](https://boards.straightdope.com/u/ultrafilter)\
**Post date:** [December 3, 2002, 3:28pm UTC](https://boards.straightdope.com/t/why-is-number-5-unique/139831/16 "2002-12-03T15:28:00Z")

</div>

Doesn’t make any difference to us mathematicians. Either it’s all zeroes after a certain point, or it’s not. Before that point…who cares?

---

<div class="post-metadata">

**Author:** ![Chronos](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/chronos/32/134_2.png) [@Chronos](https://boards.straightdope.com/u/Chronos)\
**Post date:** [December 4, 2002, 12:13am UTC](https://boards.straightdope.com/t/why-is-number-5-unique/139831/17 "2002-12-04T00:13:40Z")

</div>

> [@](#):
>
> Doesn’t make any difference to us mathematicians. Either it’s all zeroes after a certain point, or it’s not. Before that point…who cares?

It durn well should matter. If **rampisad** ’s observation is correct, that for every prime n, 1/n repeats after n-1 digits, and if this property is true only for primes, then it’s a quick and certain test of primality. Need I point out that there is currently no such test, and that such a test would be extremely useful in, say, cryptography?

Actually, it turns out that this is not a feature unique to primes. I just did some checking, and 1/33 = 0.03, which would repeat in blocks of 32. It’s still an interesting property, though.

---

<div class="post-metadata">

**Author:** ![ultrafilter](https://avatars.discourse-cdn.com/v4/letter/u/3d9bf3/32.png) [@ultrafilter](https://boards.straightdope.com/u/ultrafilter)\
**Post date:** [December 4, 2002, 12:16am UTC](https://boards.straightdope.com/t/why-is-number-5-unique/139831/18 "2002-12-04T00:16:37Z")

</div>

OK, Chronos, you got me.

However, I might point out that 1/33 repeats after fewer than 32 iterations. It would be interesting to see what kind of numbers n have reciprocals that repeat after exactly n - 1 digits.

I have some number theory to do, I think.

---

<div class="post-metadata">

**Author:** ![ultrafilter](https://avatars.discourse-cdn.com/v4/letter/u/3d9bf3/32.png) [@ultrafilter](https://boards.straightdope.com/u/ultrafilter)\
**Post date:** [December 4, 2002, 12:23am UTC](https://boards.straightdope.com/t/why-is-number-5-unique/139831/19 "2002-12-04T00:23:41Z")

</div>

Of course, 1/11 = .09 kinda ruins any hope of that being a necessary and sufficient condition for primality, but if it were either of the two, that would be nice.

That, and there was that recently published algorithm which was O([symbol]b[/symbol][sup]12[/sup]). O([symbol]b[/symbol][sup]3[/sup]) if ERT is true, I think.

---

<div class="post-metadata">

**Author:** ![rampisad](https://avatars.discourse-cdn.com/v4/letter/r/858c86/32.png) [@rampisad](https://boards.straightdope.com/u/rampisad)\
**Post date:** [December 4, 2002, 11:08am UTC](https://boards.straightdope.com/t/why-is-number-5-unique/139831/20 "2002-12-04T11:08:29Z")

</div>

chronos says

> [@](#):
>
> However, I might point out that 1/33 repeats after fewer than 32 iterations.

As **Saltire** points out I was being very specific in my OP that “the pattern will repeat in (n-1) digits”. In fact, can be stated better that the pattern will repeat in **some factor** of (n-1) digits.

[Next page](https://boards.straightdope.com/t/why-is-number-5-unique/139831.md?page=2)
