recurring numbers

Get your science fix here: research, quackery, activism and all the rest
Post Reply
Allo V Psycho
Catbabel
Posts: 737
Joined: Sat Nov 16, 2019 8:18 am

recurring numbers

Post by Allo V Psycho » Mon Dec 04, 2023 9:51 am

I had to work out the fraction that 39 represented of 99, and was pleased to find it was 0.39393939....and any fraction x of 99 (up to 99, obviously, and above that the pattern shifts) is the recurrent value 0.x. Is there a name for this property?

User avatar
Grumble
Light of Blast
Posts: 4776
Joined: Mon Nov 11, 2019 1:03 pm

Re: recurring numbers

Post by Grumble » Mon Dec 04, 2023 11:51 am

Allo V Psycho wrote:
Mon Dec 04, 2023 9:51 am
I had to work out the fraction that 39 represented of 99, and was pleased to find it was 0.39393939....and any fraction x of 99 (up to 99, obviously, and above that the pattern shifts) is the recurrent value 0.x. Is there a name for this property?
That’s really neat, I never knew that. Haven’t got an answer for you though.
where once I used to scintillate
now I sin till ten past three

geejaytee
Clardic Fug
Posts: 185
Joined: Mon Nov 11, 2019 1:32 pm
Location: Norf Landan, mate

Re: recurring numbers

Post by geejaytee » Mon Dec 04, 2023 11:55 am

There's a mathematical explanation for this, and it runs roughly as follows:

The repeating decimal 0.ababababababab.... can be written as

ab * (0.01 + 0.0001 + 0.000001 + other terms with number of zeros increasing by 2), which can be summarised as

ab * sum of 0.01^n as n goes from 1 to infinity.

This is a geometric series, with common ratio 0.01 and can be summed using the formula a/(1-r) where a is the first term and r is the common ratio.

1 - 0.01 is 0.99, and the first term is 0.ab, so it simplifies to:

0.ab/0.99 = ab/99.

A similar technique can be used for other repeating decimals - 0.abcabcabcabcabcabc... for instance is abc/999 (the common ratio is 1/1000 in the geometric series for this one) - and can be extended to a method to calculate the fraction for any decimal which eventually repeats.
Last edited by geejaytee on Mon Dec 04, 2023 11:56 am, edited 1 time in total.

geejaytee
Clardic Fug
Posts: 185
Joined: Mon Nov 11, 2019 1:32 pm
Location: Norf Landan, mate

Re: recurring numbers

Post by geejaytee » Mon Dec 04, 2023 11:56 am

Quote rather than edit, ha.

User avatar
Gfamily
Light of Blast
Posts: 5229
Joined: Mon Nov 11, 2019 1:00 pm
Location: NW England

Re: recurring numbers

Post by Gfamily » Mon Dec 04, 2023 12:32 pm

It's just called a repeating or recurring decimal.

https://en.m.wikipedia.org/wiki/Repeating_decimal

I would be interested to check whether it's the same for any number n , nn, nnn etc expressed in Base n+1.
I think it seems likely
My avatar was a scientific result that was later found to be 'mistaken' - I rarely claim to be 100% correct
ETA 5/8/20: I've been advised that the result was correct, it was the initial interpretation that needed to be withdrawn
Meta? I'd say so!

User avatar
dyqik
Princess POW
Posts: 7571
Joined: Wed Sep 25, 2019 4:19 pm
Location: Masshole
Contact:

Re: recurring numbers

Post by dyqik » Mon Dec 04, 2023 2:33 pm

Gfamily wrote:
Mon Dec 04, 2023 12:32 pm
It's just called a repeating or recurring decimal.

https://en.m.wikipedia.org/wiki/Repeating_decimal

I would be interested to check whether it's the same for any number n , nn, nnn etc expressed in Base n+1.
I think it seems likely
I think GJT's explanation above applies to bases other than ten. However, I can't make it work with hexadecimal floats in Python, but I think that's because <float>.hex() doesn't actually convert the float to base 16, but instead shows the hexadecimal for the IEEE representation of the decimal float.

e.g. replace:
1 - 0.01 is 0.99, and the first term is 0.ab, so it simplifies to:

0.ab/0.99 = ab/99.
with:

1 - 0.01 is 0.ff, and the first term is 0.ab, so it simplifies to:

0.ab/0.ff = ab/ff.

IvanV
Stummy Beige
Posts: 2714
Joined: Mon May 17, 2021 11:12 am

Re: recurring numbers

Post by IvanV » Wed Dec 13, 2023 1:29 pm

999999 has factors including 7, 13 and 37. But they are factors of no smaller integer made up of repeated 9s, as with 3 and 11. (3, 7, 11, 13 and 37 are the only prime factors of 999999). That is why the recurring decimals for n/7, n/13 and n/37, and compounds of those such as n/91, have a repeated group of 6 figures.

It is easy to understand that any prime p (that is not a factor of 10) must have a recurring decimal of at most p-1 digits. This is apparent because when you are doing a long division to it work out, it must cycle back to where you started in at most p-1 steps. That's because the remainder is always a number somewhere from 1 to p-1. So that presents an interesting way of discovering that any prime p (that is not a factor of 10) must divide exactly into at least one integer made up of repeated 9s of at most p-1 digits. Also true for repeated 1s and repeated 3s, for we can take out the factors of 3.

Post Reply