login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Number of decimal places before 1/n either recurs or terminates.
6

%I #25 Jul 20 2022 15:20:58

%S 0,1,1,2,1,2,6,3,1,1,2,3,6,7,2,4,16,2,18,2,6,3,22,4,2,7,3,8,28,2,15,5,

%T 2,17,7,3,3,19,6,3,5,7,21,4,2,23,46,5,42,2,16,8,13,4,3,9,18,29,58,3,

%U 60,16,6,6,7,3,33,18,22,7,35,4,8,4,3,20,6,7,13,4,9,6,41,8,17,22,28,5,44,2,6

%N Number of decimal places before 1/n either recurs or terminates.

%C In this sequence, the repeating decimals (e.g., 1/7) are treated differently from nonrepeating decimals (e.g., 1/5). If they are treated the same, then a(2)=2, a(4)=3, a(5)=2, a(8)=4, a(10)=2, ... and we obtain A054710. The two sequence differ only for n = 2^j * 5^k.

%H T. D. Noe, <a href="/A121341/b121341.txt">Table of n, a(n) for n = 1..1000</a> (corrected by Sean A. Irvine, Apr 29 2022)

%H <a href="/index/1#1overn">Index entries for sequences related to decimal expansion of 1/n</a>

%F a(n) = A051628(n) + A051626(n). - _Sean A. Irvine_, Apr 13 2022

%e 1/592 = 0.0016891891891... starts with 4 decimals (0016, zeros counted) and has period 3 (digits 891) to yield a(592) = 4 + 3 = 7.

%t a[n_] := Max[IntegerExponent[n, 2], IntegerExponent[n, 5]] + Length[RealDigits[1/n][[1, -1]]];

%t Table[a[n], {n, 1, 100}] (* _Jean-François Alcover_, Jul 20 2022 *)

%Y A007732 is the length of the periods and serves as a lower bound. Cf. A061075.

%Y Cf. A051626, A051628.

%K base,easy,nice,nonn

%O 1,4

%A _Anthony C Robin_, Aug 29 2006

%E More terms from _T. D. Noe_, Aug 30 2006

%E Additional comments from _R. J. Mathar_, Aug 30 2006