Relationship between prime numbers and repeating digits in rational numbers

Share the projects you're working on! Ask for feedback (if you want!) or just show off! Help others with their works! Collaborate! Make stuff!
Post Reply
Message
Author
User avatar
ben
Posts: 7
Joined: Fri Mar 11, 2022 11:21 pm

Relationship between prime numbers and repeating digits in rational numbers

#1 Post by ben »

:cool: Here's a fun game. Find the next three numbers in this sequence:

0 1 0 6 2 6 16 18 22 28 15

(Hint: These numbers are generated from the series of primes.)
► Show Spoiler
Did you guess it right? (How the heck did you figure that out?) :dead:

I was bored one day and wondered why 1/7 is 0.1428571428571428571... repeating forever. The pattern is 142857, which is 6 digits long.

1/11 is 0.09090909... this time only 2 digits: 0 and 9.

1/13 is 6 digits again.

1/17 is 16 repeating digits. Hmm what is going on? :huh:

Taking the sequence 1/x = y where x is every prime number and y is the length of the repeating pattern in the decimals, I generated these points.

(2, 0), (3, 1), (5, 0), (7, 6), (11, 2), (13, 6), (17, 16), (19, 18), (23, 22), (29, 28), (31, 15), (37, 3), (41, 5), (43, 21), (47, 46), (53, 13), (59, 58), (61, 60), (67, 33), (71, 35), (73, 8), (79, 13),
(83, 41), (89, 44), (97, 96), (101, 4), (103, 34), (107, 53), (109, 108), (113, 112), (127, 42), (131, 130), (137, 8), (139, 46), (149, 148), (151, 75), (157, 78), (163, 81), (167, 166), (173, 43), (179, 178), (181, 180), (191, 95), (193, 192), (197, 98), (199, 99), (211, 30), (223, 222), (227, 113)

I'm sure I'm not the first person to "discover/invent" this sequence. :cool:

The most frequent length is x-1. The next most likely is (x-1)/2 etc. as you can see from this graph:
Image :huh:

My conjectures are as follows:

1. Any given prime number will always generate a repeating pattern of the same length if it is in the denominator, regardless of what is in the numerator. :zonked:

2.Decimals resulting from division by a prime number will never have leading digits before the repeating pattern starts. For example 1/12 will be 0.083333. 3 repeats forever. The leading digits are 0 and 8, because 12 is not prime.

3.Fractions will never have repeating patterns longer than the largest prime factor of the denominator - 1.

4. Any whole number in the denominator will generate the same length repeating pattern as its largest prime factor. :woah:
(Numbers with the largest prime factor of 3 seem to be an exception.)

Let's take some random number 245 / 627. Ignore the top number. 627's largest prime factor is 19. 1/19 has a repeating pattern of 18 digits. So n / 627 should always have a repeating pattern of 18 digits. Lets see... :huh:

0.0015948963317384370015948963317384370015948963317384370015948963

Yup! The repeating pattern is 001594896331738437. That's 18 digits! :woah:

I'm sure this is already known, but I think it's pretty neat if true. :cool:

Is this interesting at all? :huh:
Can you find any counter-examples? :mad:
Do you notice any patterns? :star:
Can you think of anywhere in real life where this might be useful? :unimpressed:
What else should I try? :zonked:
Do you know why numbers be like they are? :frog:

Do you want more math posts?
Post your thoughts below. :glad:

Tags:

User avatar
uhpkkim
Posts: 95
Joined: Fri Dec 10, 2021 7:16 pm
Name 2: PK
Pronouns: they/them
Contact:

#2 Post by uhpkkim »

:woah: woah this is neat! I stopped understanding towards the end but this is exactly the type of wizard brain shit i love :cool:

User avatar
ben
Posts: 7
Joined: Fri Mar 11, 2022 11:21 pm

#3 Post by ben »

Literally 2 days after I posted this, Numberphile did a video on it. :eyes:

User avatar
uhpkkim
Posts: 95
Joined: Fri Dec 10, 2021 7:16 pm
Name 2: PK
Pronouns: they/them
Contact:

#4 Post by uhpkkim »

Ain't that just the way.

That dude Shanks was very dedicated to sittin and diggin around with numbers for a long time. I'm here for it

Post Reply