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.
LINKS
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