cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A051628 Number of digits in decimal expansion of 1/n before the periodic part begins.

Original entry on oeis.org

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

Views

Author

Keywords

Examples

			1/8 = .1250000... so a(8)=3, 1/15 = .0666666..., so a(15)=1.
		

Crossrefs

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)
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)

Extensions

More terms from Michael Lugo (mlugo(AT)thelabelguy.com), Dec 22 1999
More terms from Franklin T. Adams-Watters, May 05 2006