Mathematica 9 is now available
Student Support Forum
Student Support Forum: 'MultiplicativeOrder' topicStudent Support Forum > General > Archives > "MultiplicativeOrder"

Help | Reply To Topic
Author Comment/Response
01/26/12 5:34pm

In mathematica 7.0 i found a function:

The function digitCycleLength gives the digit period for any rational number r in base b:

digitCycleLength[r_Rational, b_Integer?Positive] :=
FixedPoint[Quotient[#, GCD[#, b]] &, Denominator[r]]]

digitCycleLength[1/3,10]=1 because 1/3=0.(3)
but why
digitCycleLength[1/2,10]=1 ? because 1/2=0.5=0.4(9)? IMO the result should be 0

URL: ,
Help | Reply To Topic