This site is supported by donations to The OEIS Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A007732 Period of decimal representation of 1/n. 33
 1, 1, 1, 1, 1, 1, 6, 1, 1, 1, 2, 1, 6, 6, 1, 1, 16, 1, 18, 1, 6, 2, 22, 1, 1, 6, 3, 6, 28, 1, 15, 1, 2, 16, 6, 1, 3, 18, 6, 1, 5, 6, 21, 2, 1, 22, 46, 1, 42, 1, 16, 6, 13, 3, 2, 6, 18, 28, 58, 1, 60, 15, 6, 1, 6, 2, 33, 16, 22, 6, 35, 1, 8, 3, 1, 18, 6, 6, 13, 1, 9, 5, 41, 6, 16, 21, 28, 2, 44, 1 (list; graph; refs; listen; history; text; internal format)
 OFFSET 1,7 COMMENTS Appears to be a divisor of A007733*A007736. - Henry Bottomley, Dec 20 2001 Primes p such that a(p)=p-1 are in A001913. [Dmitry Kamenetsky, Nov 13 2008] When 1/n has a finite decimal expansion (namely, when n = 2^a*5^b), a(n) = 1 while A051626(n) = 0. - M. F. Hasler, Dec 14 2015 REFERENCES J. H. Conway and R. K. Guy, The Book of Numbers, Copernicus Press, NY, 1996, pp. 159 etc. LINKS Jon E. Schoenfield, Table of n, a(n) for n = 1..10000 (first 1000 terms from T. D. Noe) Project Euler, Reciprocal cycles: Problem 26 FORMULA Note that if n=r*s where r is a power of 2 and s is odd then a(n)=a(s). Also if n=r*s where r is a power of 5 and s is not divisible by 5 then a(n) = a(s). So we just need a(n) for n not divisible by 2 or 5. This is the smallest number m such that n divides 10^m - 1; m is a divisor of phi(n), where phi = A000010. phi(n) = n-1 only if n is prime and since a(n) divides phi(n), a(n) can only equal n-1 if n is prime. - Scott Hemphill (hemphill(AT)alumni.caltech.edu), Nov 23 2006 a(n)=a(A132740(n)); a(A132741(n))=a(A003592(n))=1. - Reinhard Zumkeller, Aug 27 2007 MAPLE A007732 := proc(n)     option remember;     local npr, phid, m ;     if n = 1 then         1;     else         npr := n ;         while (npr mod 2 )=0 do             npr := npr/2 ;         end do:         while (npr mod 5 )=0 do             npr := npr/5 ;         end do:         if npr <> n then             return procname(npr) ;         else             phid := sort(convert(numtheory[divisors](numtheory[phi](npr)), list)) ;             for m in phid do                 if (10^m-1) mod n = 0 then                     return m;                 end if;             end do;         end if;     end if; end proc: # R. J. Mathar, Oct 17 2012 MATHEMATICA Table[r = n/2^IntegerExponent[n, 2]/5^IntegerExponent[n, 5]; MultiplicativeOrder[10, r], {n, 100}] (* T. D. Noe, Oct 17 2012 *) digitCycleLength[r_Rational, b_Integer?Positive] := MultiplicativeOrder[b, FixedPoint[ Quotient[#, GCD[#, b]] &, Denominator[r]]]; (* from Mathematica help file for MultiplicativeOrder *) Array[ digitCycleLength[1/#, 10] &, 100, 2] (* Robert G. Wilson v, Aug 18 2014 *) PROG (PARI) A007732(n, amax)={ if( n % 2== 0, return(A007732(n/2, amax)) ; ) ; if( n % 5== 0, return(A007732(n/5, amax)) ; ) ; for(m=1, amax, if( (10^m-1) % n == 0, return(m) ; ) ; ) ; return(-1) ; } { for(n=1, 100, print(n, " ", A007732(n, 500)) ; ) ; } \\ R. J. Mathar, Aug 30 2006 (PARI) a(n)=znorder(Mod(10, n/2^valuation(n, 2)/5^valuation(n, 5))) \\ Charles R Greathouse IV, Jan 14 2013 (Python) from sympy import divisors, totient def a(n):     if n==1: return 1     else:         npr=n         while npr%2==0:npr/=2         while npr%5==0:npr/=5         if npr!=n: return a(npr)         else:             phid=divisors(totient(npr))             for m in phid:                 if (10**m - 1)%n==0: return m print map(a, xrange(1, 101)) # Indranil Ghosh, Jul 13 2017, after Maple code by R. J. Mathar CROSSREFS Cf. A121341, A066799, A121090, A001913, A084680. Sequence in context: A324544 A323160 A323166 * A237835 A126795 A276997 Adjacent sequences:  A007729 A007730 A007731 * A007733 A007734 A007735 KEYWORD nonn,base,easy,nice AUTHOR N. J. A. Sloane, Hal Sampson [ hals(AT)easynet.com ] EXTENSIONS More terms from James A. Sellers, Feb 05 2000 STATUS approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

Last modified June 19 17:15 EDT 2019. Contains 324222 sequences. (Running on oeis4.)