MathGroup Archive 2010

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

Search the Archive

Re: Cyclical Decimal Expansion

  • To: mathgroup at smc.vnet.net
  • Subject: [mg114420] Re: Cyclical Decimal Expansion
  • From: cjay <christian.jay at noos.fr>
  • Date: Sat, 4 Dec 2010 06:11:38 -0500 (EST)

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