login
A051628
Number of digits in decimal expansion of 1/n before the periodic part begins.
8
0, 1, 0, 2, 1, 1, 0, 3, 0, 1, 0, 2, 0, 1, 1, 4, 0, 1, 0, 2, 0, 1, 0, 3, 2, 1, 0, 2, 0, 1, 0, 5, 0, 1, 1, 2, 0, 1, 0, 3, 0, 1, 0, 2, 1, 1, 0, 4, 0, 2, 0, 2, 0, 1, 1, 3, 0, 1, 0, 2, 0, 1, 0, 6, 1, 1, 0, 2, 0, 1, 0, 3, 0, 1, 2, 2, 0, 1, 0, 4, 0, 1, 0, 2, 1, 1, 0, 3, 0, 1, 0, 2, 0, 1, 1, 5, 0, 1, 0, 2, 0, 1, 0, 3, 1
OFFSET
1,4
FORMULA
For n>1, a(n) = max(i, j) where n=2^i*3^x*5^j*... is the prime decomposition of n.
From Amiram Eldar, Aug 25 2024: (Start)
a(n) = max(A007814(n), A112765(n)).
a(n) = A051903(A132741(n)).
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = 41/36. (End)
EXAMPLE
1/8 = .1250000... so a(8)=3, 1/15 = .0666666..., so a(15)=1.
MATHEMATICA
a[n_] := Max[IntegerExponent[n, 2], IntegerExponent[n, 5]];
Table[a[n], {n, 1, 105}] (* Jean-François Alcover, Jul 20 2022, after Chai Wah Wu *)
PROG
(Python)
from sympy import multiplicity
def A051628(n): return max(multiplicity(2, n), multiplicity(5, n)) # Chai Wah Wu, Feb 07 2022
(PARI) a(n) = max(valuation(n, 2), valuation(n, 5)); \\ Michel Marcus, Oct 27 2022
CROSSREFS
KEYWORD
nonn,nice,easy,base
EXTENSIONS
More terms from Michael Lugo (mlugo(AT)thelabelguy.com), Dec 22 1999
More terms from Franklin T. Adams-Watters, May 05 2006
STATUS
approved