[go: up one dir, main page]

login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A307388
Length of the period of decimal representation of Product_{k=1..n} A038111(k)/A038110(k).
0
1, 27, 729, 59049, 43046721, 31381059609, 68630377364883, 150094635296999121, 328256967394537077627, 717897987691852588770249, 4710128697246244834921603689, 92709463147897837085761925410587, 3649600726280146254718103955713167842
OFFSET
9,2
COMMENTS
The offset is 9 since for 0 < n < 5, the product is an integer, and for 4 < n < 9 the decimal expansion ends with zeros.
EXAMPLE
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.
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]
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Jamie Morken, Apr 06 2019
STATUS
approved