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.

This page as a plain text file.
%I A051628 #34 Aug 25 2024 09:59:35
%S A051628 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,
%T A051628 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,
%U A051628 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
%N A051628 Number of digits in decimal expansion of 1/n before the periodic part begins.
%H A051628 T. D. Noe, <a href="/A051628/b051628.txt">Table of n, a(n) for n=1..1000</a>
%H A051628 Luis Lopes, <a href="https://web.archive.org/web/20231116182731/http://forumgeom.fau.edu/POLYA/ProblemCenter/POLYA013.html">POLYA013: Length of the nonperiodic part of the decimal expansion of 1/N</a>, The Problem Center, POLYA, 2001. [Wayback Machine link]
%H A051628 <a href="/index/1#1overn">Index entries for sequences related to decimal expansion of 1/n</a>.
%F A051628 For n>1, a(n) = max(i, j) where n=2^i*3^x*5^j*... is the prime decomposition of n.
%F A051628 From _Amiram Eldar_, Aug 25 2024: (Start)
%F A051628 a(n) = max(A007814(n), A112765(n)).
%F A051628 a(n) = A051903(A132741(n)).
%F A051628 Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = 41/36. (End)
%e A051628 1/8 = .1250000... so a(8)=3, 1/15 = .0666666..., so a(15)=1.
%t A051628 a[n_] := Max[IntegerExponent[n, 2], IntegerExponent[n, 5]];
%t A051628 Table[a[n], {n, 1, 105}] (* _Jean-François Alcover_, Jul 20 2022, after _Chai Wah Wu_ *)
%o A051628 (Python)
%o A051628 from sympy import multiplicity
%o A051628 def A051628(n): return max(multiplicity(2,n),multiplicity(5,n)) # _Chai Wah Wu_, Feb 07 2022
%o A051628 (PARI) a(n) = max(valuation(n, 2), valuation(n, 5)); \\ _Michel Marcus_, Oct 27 2022
%Y A051628 Cf. A007814, A051903, A112765, A132741.
%K A051628 nonn,nice,easy,base
%O A051628 1,4
%A A051628 _N. J. A. Sloane_
%E A051628 More terms from Michael Lugo (mlugo(AT)thelabelguy.com), Dec 22 1999
%E A051628 More terms from _Franklin T. Adams-Watters_, May 05 2006