Periods of Reciprocals of Integers
|
08-05-2018, 08:49 PM
(This post was last modified: 08-06-2018 01:37 AM by Thomas Klemm.)
Post: #2
|
|||
|
|||
RE: Periods of Reciprocals of Integers
(12-30-2017 02:19 PM)Macumazahn Wrote: This made me wonder how to determine the period of the decimal representation of the reciprocal of an integer. In case of \(n=13\) the period \(k=6\) and therefore we can write \(\frac{1}{13}=\frac{76,923}{999,999}\). This is a consequence of the formula to calculate the geometric series. However this means that \(13\times76,923=999,999\) and thus in general: \(n\) divides \(10^k-1\). For this to work properly we have to make sure that \(n\) doesn't share divisors with \(10\). Here's a program for the HP-41: Code: LBL "PERIOD" This is a translation of the following Python program: Code: def period(n): There are probably more efficient ways to calculate the smallest integer \(k\) such that \(10^k\equiv1(\mod n)\) since it divides the Carmichael Function \(\lambda(n)\). But for this we'd need to know the prime-factors of \(n\). Kind regards Thomas |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
Periods of Reciprocals of Integers - Macumazahn - 12-30-2017, 02:19 PM
RE: Periods of Reciprocals of Integers - Thomas Klemm - 08-05-2018 08:49 PM
RE: Periods of Reciprocals of Integers - Albert Chan - 08-06-2018, 12:59 AM
RE: Periods of Reciprocals of Integers - Thomas Klemm - 08-06-2018, 03:37 AM
RE: Periods of Reciprocals of Integers - Albert Chan - 08-06-2018, 02:05 PM
RE: Periods of Reciprocals of Integers - Thomas Klemm - 08-06-2018, 05:30 PM
RE: Periods of Reciprocals of Integers - Albert Chan - 08-06-2018, 07:41 PM
|
User(s) browsing this thread: 6 Guest(s)