A051628 Number of digits in decimal expansion of 1/n before the periodic part begins.
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
Examples
1/8 = .1250000... so a(8)=3, 1/15 = .0666666..., so a(15)=1.
Links
- T. D. Noe, Table of n, a(n) for n=1..1000
- Luis Lopes, POLYA013: Length of the nonperiodic part of the decimal expansion of 1/N, The Problem Center, POLYA, 2001. [Wayback Machine link]
- Index entries for sequences related to decimal expansion of 1/n.
Programs
-
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 *)
-
PARI
a(n) = max(valuation(n, 2), valuation(n, 5)); \\ Michel Marcus, Oct 27 2022
-
Python
from sympy import multiplicity def A051628(n): return max(multiplicity(2,n),multiplicity(5,n)) # Chai Wah Wu, Feb 07 2022
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)
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = 41/36. (End)
Extensions
More terms from Michael Lugo (mlugo(AT)thelabelguy.com), Dec 22 1999
More terms from Franklin T. Adams-Watters, May 05 2006