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.
%I A114205 #55 Jul 22 2025 10:31:31 %S A114205 5,0,25,2,1,0,125,0,1,0,8,0,0,0,625,0,0,0,5,0,0,0,41,4,0,0,3,0,0,0, %T A114205 3125,0,0,0,2,0,0,0,25,0,0,0,2,0,0,0,208,0,2,0,1,0,0,0,17,0,0,0,1,0,0, %U A114205 0,15625,0,0,0,1,0,0,0,13,0,0,1,1,0,0,0,125,0,0,0,1,0,0,0,11,0,0,0,10 %N A114205 Write decimal expansion of 1/n as 0.PPP...PQQQ..., where QQQ... is the cyclic part. If the expansion does not terminate, any leading 0's in QQQ... are regarded as being at the end of the PPP...P part. Sequence gives PPP...P, right justified, with leading zeros omitted. %C A114205 b(n) = A386406(n) gives the length of P (including leading zeros), c(n) = A036275(n) gives the smallest cycle in QQQ... (including terminating zeros) and d(n) = A051626(n) gives the length of that cycle. %C A114205 Thus 1/n = 10^(-b(n)) * ( a(n) + c(n)/(10^d(n) - 1) ). When c(n)=d(n)=0, the fraction c(n)/(10^d(n) - 1), which is 0/0, evaluates (by definition) to 0. %e A114205 n .. expansion of 1/n .... a b c d %e A114205 2 .50000000000000000000... 5 1 0 0 %e A114205 3 .33333333333333333333... 0 0 3 1 %e A114205 4 .25000000000000000000... 25 2 0 0 %e A114205 5 .20000000000000000000... 2 1 0 0 %e A114205 6 .16666666666666666667... 1 1 6 1 %e A114205 7 .14285714285714285714... 0 0 142857 6 %e A114205 8 .12500000000000000000... 125 3 0 0 %e A114205 9 .11111111111111111111... 0 0 1 1 %e A114205 10 .1000000000000000000... 1 1 0 0 %e A114205 11 .0909090909090909090... 0 1 90 2 %e A114205 12 .0833333333333333333... 8 2 3 1 %e A114205 13 .0769230769230769230... 0 1 769230 6 %e A114205 14 .0714285714285714285... 0 1 714285 6 %e A114205 15 .0666666666666666666... 0 1 6 1 %e A114205 16 .0625000000000000000... 625 4 0 0 %e A114205 (Start) %e A114205 92 .0108695652173913043... 10 3 869...260 22 %e A114205 102 .009803921568627450... 0 2 980...450 16 %e A114205 416 .002403846153846153... 240 5 384615 6 %e A114205 4544 .00022007042253521... 2200 7 704...450 35 %e A114205 (End) - _Ruud H.G. van Tol_, Nov 20 2024 %p A114205 A114205 := proc(n) local sh,lpow,mpow,a,b ; lpow:=1 ; while true do for mpow from lpow-1 to 0 by -1 do if (10^lpow-10^mpow) mod n =0 then a := (10^lpow-10^mpow)/n ; sh := 10^(lpow-mpow)-1 ; b := a mod sh ; a := floor(a/sh) ; while b>0 and b*10 < sh+1 do a := 10*a ; b := 10*b ; end ; RETURN(a) ; fi ; od ; lpow := lpow+1 ; od ; end: for n from 2 to 600 do printf("%d %d ",n,A114205(n)) ; od ; # _R. J. Mathar_, Oct 19 2006 %t A114205 fa[n_] := Block[{p},p = First[RealDigits[1/n]];If[ ! IntegerQ[Last[p]], p = Join[Most[p],TakeWhile[Last[p],#==0&]]];FromDigits[p]];Table[fa[n], {n, 100}] (* _Ray Chandler_, Oct 18 2006 *) %o A114205 (PARI) a(n)= my(s=max(valuation(n, 2), valuation(n, 5))); s||return(0); my([p, r]= divrem(10^s, n)); if(r&&(r=n\r)>9, s+=logint(r, 10)); 10^s\n; \\ _Ruud H.G. van Tol_, Nov 19 2024 %Y A114205 Cf. A386406, A114206, A036275, A051626, A060284, A007732, A175555. %K A114205 nonn,base %O A114205 2,1 %A A114205 _N. J. A. Sloane_, Oct 17 2006 %E A114205 More terms from _Ray Chandler_ and _Hans Havermann_, Oct 18 2006 %E A114205 I would also like to get programs that produce this and A114206, A036275, A051626 in Maple. %E A114205 Edited by _Andrei Zabolotskii_, Jul 20 2025