A307388 Length of the period of decimal representation of Product_{k=1..n} A038111(k)/A038110(k).
1, 27, 729, 59049, 43046721, 31381059609, 68630377364883, 150094635296999121, 328256967394537077627, 717897987691852588770249, 4710128697246244834921603689, 92709463147897837085761925410587, 3649600726280146254718103955713167842
Offset: 9
Examples
For example for n=9 with (2/1) * (6/1) * (15/1) * (105/4) * (385/8) * (1001/16) * (17017/192) * (323323/3072) * (7436429/55296) = 2759414170256180364552625 / 154618822656 = 17846560482454.30745852273604315188195970323350694444444444444... so a(9) = 1.
Links
- Jamie Morken, Mathematica Stack Exchange question
Programs
-
Mathematica
Primorial[n_] := Times @@ Prime[Range[n]] ClearAll[iter] ClearAll[fracPer, vp]; (*p-adic order*) vp[p_?PrimeQ, n_Integer] := Length@NestWhileList[#/p &, n/p, IntegerQ] - 1; (*fraction decimal expansion period*) fracPer[q_Integer] := 0; fracPer[q_Rational] := Module[{den, p2, p5}, den = Denominator[q]; p2 = vp[2, den]; p5 = vp[5, den]; den = den/2^p2/5^p5; If[den == 1, 0, MultiplicativeOrder[10, den]]]; iter[{periods_, frac_, n_}] := {{periods, fracPer[#]}, #, n + 1} &[ frac*Primorial[n]/EulerPhi[Primorial[Max[1, n - 1]]]]; Flatten@First@ Nest[iter, {0, Primorial[0]/EulerPhi[Primorial[0]], 0}, 50]
Comments