Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Ad hoc I have no good idea. Maybe <a href="http://en.wikipedia.org/wiki/Continued_fraction" rel="nofollow noreferrer">continued fractions</a> can help. I am going to think a bit about it ...</p> <p><strong>UPDATE</strong></p> <p><strike> From <a href="http://en.wikipedia.org/wiki/Fermat&#39;s_little_theorem" rel="nofollow noreferrer">Fermat's little theorem</a> and because 39 is prime the following holds. (<code>=</code> indicates congruence)</p> <pre><code>10^39 = 10 (39) </code></pre> <p>Because 10 is coprime to 39.</p> <pre><code>10^(39 - 1) = 1 (39) 10^38 - 1 = 0 (39) [to be continued tomorow] </code></pre> <p></strike></p> <p>I was to tiered to recognize that 39 is not prime ... ^^ I am going to update and the answer in the next days and present the whole idea. Thanks for noting that 39 is not prime.</p> <p>The short answer for <code>a/b</code> with <code>a &lt; b</code> and an assumed period length <code>p</code> ...</p> <ul> <li>calculate <code>k = (10^p - 1) / b</code> and verify that it is an integer, else <code>a/b</code> has not a period of <code>p</code></li> <li>calculate <code>c = k * a</code></li> <li>convert <code>c</code> to its decimal represenation and left pad it with zeros to a total length of <code>p</code></li> <li>the i-th digit after the decimal point is the (i mod p)-th digit of the paded decimal representation (i = 0 is the first digit after the decimal point - we are developers)</li> </ul> <p>Example</p> <pre><code>a = 3 b = 7 p = 6 k = (10^6 - 1) / 7 = 142,857 c = 142,857 * 3 = 428,571 </code></pre> <p>Padding is not required and we conclude.</p> <pre><code>3 ______ - = 0.428571 7 </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload