Results 1 to 3 of 3

Thread: Recurring Decimal

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Dec 2007
    Posts
    167

    Recurring Decimal

    lets say we have
    x = 1/7

    x = 0.142857 142857 142857 142857
    the recurring cycle in this decimal is 142857

    is there anyway to find this, or at least the length of it?
    for example, if x = 1/7 >> y = 142857

    I don't want a code, I want a method...
    Thanks
    Im using Visual Studio 2008 Professional Edition
    .Net Framework 3.5

  2. #2
    PowerPoster
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,070

    Re: Recurring Decimal

    Have a look on wikipedia:
    http://en.wikipedia.org/wiki/Recurring_decimal

    Quite interesting tbh, although I never thought about it before.

    From the wikipedia site:
    From this kind of argument, we can see that the period of the repeating decimal of a fraction n⁄d will be (at most) the smallest number k such that 10k − 1 is divisible by d.

    For example, the fraction 2⁄7 has d = 7, and the smallest k that makes 10k − 1 divisible by 7 is k = 6, because 999999 = 7 × 142857. The period of the fraction 2⁄7 is therefore 6.

    In the case of a prime denominator (exluding 2 and 5) such as (1/p) , the period (number of digits in the recurring 'sequence') is always (p-1) or a divisor of (p-1).

    For example, 1/7 = 0.142857... which has 7-1 = 6 recurring digits.
    For example, 1/13 = 0.076923… which has (13-1)/2 = 6 recurring digits.

    I don't know how you can decide (with 1/13 for example) if it's (13-1) or (13-1)/n though...

  3. #3
    Only Slightly Obsessive jemidiah's Avatar
    Join Date
    Apr 2002
    Posts
    2,431

    Re: Recurring Decimal

    Quote Originally Posted by NickThissen
    In the case of a prime denominator (exluding 2 and 5) such as (1/p) , the period (number of digits in the recurring 'sequence') is always (p-1) or a divisor of (p-1).
    I just thought I'd point out that this is a result of Fermat's Little Theorem (I had to look it up to make sure it worked ). Even the cases where it doesn't work, 2 and 5, are accounted for since a and p have to be coprime.

    As for finding the smallest k... I really have no idea. I never was very good at number theory. You might be able to use Euler's Theorem which happens to be a generalization of Fermat's Little Theorem; perhaps Nick or someone else could help apply it in this case.
    The time you enjoy wasting is not wasted time.
    Bertrand Russell

    <- Remember to rate posts you find helpful.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width