login
Table in which n-th row lists digits in periodic part of decimal expansion of 1/n.
5

%I #18 Feb 26 2022 10:48:13

%S 0,0,3,0,0,6,1,4,2,8,5,7,0,1,0,0,9,3,0,7,6,9,2,3,7,1,4,2,8,5,6,0,0,5,

%T 8,8,2,3,5,2,9,4,1,1,7,6,4,7,5,0,5,2,6,3,1,5,7,8,9,4,7,3,6,8,4,2,1,0,

%U 0,4,7,6,1,9,4,5,0,4,3,4,7,8,2,6,0,8,6,9,5,6,5,2,1,7,3,9,1,3

%N Table in which n-th row lists digits in periodic part of decimal expansion of 1/n.

%C The length of row n is A007732(n). - _T. D. Noe_, May 14 2008

%C The convention is that the earliest period is displayed. - _T. D. Noe_, May 14 2008

%D Conway and Guy, The Book of Numbers, p. 160

%H T. D. Noe, <a href="/A048962/b048962.txt">Rows n=1..100, flattened</a>

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

%e 1/1=1. -> 0; 1/2=.5 ->0; 1/3=.3333... -> 3; 1/4=.25 -> 0; 1/5=.2 ->0; 1/6=.1666... -> 6; 1/7=.142857... -> 1 4 2 8 5 7; etc.

%e Triangle begins:

%e 0;

%e 0;

%e 3;

%e 0;

%e 0;

%e 6;

%e 1,4,2,8,5,7;

%e 0;

%e 1;

%e 0;

%e 0,9;

%e 3;

%e 0,7,6,9,2,3;

%e 7,1,4,2,8,5;

%e 6;

%e 0;

%e ...

%t nmax = 50;

%t row[n_] := Switch[FactorInteger[n], {{2, _}} | {{5, _}} | {{2, _}, {5, _}}, {0}, _, rd = RealDigits[N[1 + 1/n, 10 nmax]]; FindTransientRepeat[rd[[1]] // Rest, 2][[2]]];

%t row /@ Range[nmax] // Flatten (* _Jean-François Alcover_, Dec 04 2019 *)

%Y Cf. A048997, A048963.

%K nonn,base,easy,tabf,nice

%O 1,3

%A _N. J. A. Sloane_