Periods of Reciprocals of Integers
|
08-06-2018, 07:41 PM
Post: #7
|
|||
|
|||
RE: Periods of Reciprocals of Integers
I wrongly assumed the half digits had written down. Sorry.
For n != 3,6,9, here is an idea: Instead of searching period and building digits 1 at a time, why not in pairs ? Multiply by 100 instead of 10, stop if reminder = 1, or 10 (1 digit passed period) Here is the search for period(n = 17): 1) 100/17 = 05 + 15/17 2) 1500/17 = 88 + 4/17 3) 400/17 = 23 + 9/17 4) 900/17 = 52 + 16/17 5) 1600/17 = 94 + 2/17 6) 200/17 = 11 + 13/17 7) 1300/17 = 76 + 8/17 8) 800/17 = 47 + 1/17 <-- stop, remainder = 1, thus period = 2*8 = 16 1/17 = 0.05 88 23 52 94 11 76 47 Unlike my previous optimization, this always cut search steps in half. Also, it showed repeating decimals pairs without storing them. |
|||
« 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: 3 Guest(s)