Post Reply 
Micro-challenge: Special Event
12-27-2022, 10:42 PM
Post: #20
RE: Micro-challenge: Special Event
(12-27-2022 08:28 PM)John Keith Wrote:  4945/2016, hence the repeating decimals ,,,,
Result: a string, "2.45287_698412_", where the underscores surround the repeating digits.

Assuming fraction fully reduced., here is the math to convert to repeating decimals.

Denominator 2016 = (25 * 50) * 63

non-repeating digits (after decimal point) = max(5, 0) = 5

We wanted smallest exponent k, such that 10^k ≡ 1 (mod 63)
1 (mod 63) is equivalent to 1 (mod 9) and 1 (mod 7), but 10^k ≡ 1^k ≡ 1 (mod 9)

1/7 = 0.(142857)      --> repeating digits = k = order of 10 (mod 7) = 6

lua> 4945 / 2016
2.452876984126984  --> 4945/2016 = 2. 45287 (698412)
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Micro-challenge: Special Event - EdS2 - 12-19-2022, 04:05 PM
RE: Micro-challenge: Special Event - johnb - 12-24-2022, 05:43 PM
RE: Micro-challenge: Special Event - EdS2 - 12-23-2022, 07:08 AM
RE: Micro-challenge: Special Event - johnb - 12-24-2022, 05:50 PM
RE: Micro-challenge: Special Event - Albert Chan - 12-27-2022 10:42 PM



User(s) browsing this thread: 1 Guest(s)