MathGroup Archive 2010

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Cyclical Decimal Expansion


if p/q is irreducible :
cycleLength[p_, q_] := 
 Module[{n = 1}, 
  If[q/(2^IntegerExponent[q, 2]* 5^IntegerExponent[q, 5]) == 1, 1, 
   While [Mod[p (10^n - 1), q] != 0, n++] ]; n]


  • Prev by Date: Re: What function to use to find matrix condition number?
  • Next by Date: Re: Changing Graph style
  • Previous by thread: Cyclical Decimal Expansion
  • Next by thread: Re: Cyclical Decimal Expansion