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 A114206 #35 Jul 22 2025 21:14:28 %S A114206 1,0,2,1,1,0,3,0,1,1,2,1,1,1,4,1,1,1,2,1,1,1,3,2,1,1,2,1,1,1,5,1,1,1, %T A114206 2,1,1,1,3,1,1,1,2,1,1,1,4,1,2,1,2,1,1,1,3,1,1,1,2,1,1,1,6,1,1,1,2,1, %U A114206 1,1,3,1,1,2,2,1,1,1,4,1,1,1,2,1,1,1,3,1,1,1,2,1,1,1,5,1,1,1,2 %N A114206 Length of the preperiodic part of the decimal expansion of 1/n, and also leading zeros from the period part if the preperiodic digits are all 0s (if any). %C A114206 Differs from A386406 at n = 92, 208, 248... %H A114206 Hans Havermann, <a href="/A114206/b114206.txt">Table of n, a(n) for n = 2..10000</a> %H A114206 <a href="/index/1#1overn">Index entries for sequences related to decimal expansion of 1/n</a>. %F A114206 a(n) = max(A004216(n), A051628(n)). - _Kevin Ryde_, Jul 22 2025 %e A114206 For n = 11, 1/n = 0.(09), so the preperiodic part is empty and the initial 0 of the periodic part is included for length a(11) = 1. %e A114206 For n = 92, 1/n = 0.01(0869565217391304347826) , so the preperiodic part is "01" and has length a(92) = 2 and the initial 0 in the periodic part is not included since that preperiodic part is not all 0s (unlike the way A386406(92) = 3 does include that inat periodic initial 0). %t A114206 fb[n_] := Block[{rd, o, p},rd = RealDigits[1/n];o = Last[rd];p = First[rd];If[ ! IntegerQ[Last[p]], p = Most[p]];Length[p] - o];Table[fb[n], {n, 120}] (* _Ray Chandler_, Oct 18 2006 *) %t A114206 r[x_]:=RealDigits[1/x]; w[x_]:=First[r[x]]; f[x_]:=First[w[x]]; l[x_]:=Last[w[x]]; z[x_]:=Last[r[x]]; b[x_]:=Which[IntegerQ[l[x]], Length[w[x]]-1*z[x], IntegerQ[f[x]]==False, -1*z[x], True, Length[Drop[w[x],-1]]-1*z[x]]; (* _Hans Havermann_, Oct 18 2006 *) %t A114206 Table[b[i], {i,2,128}] %o A114206 (PARI) a(n) = max(logint(n,10), max(valuation(n,2), valuation(n,5))); \\ _Kevin Ryde_, Jul 22 2025 %Y A114206 Cf. A004216, A051628, A114205, A386406. %K A114206 nonn,base,easy %O A114206 2,3 %A A114206 _N. J. A. Sloane_, Oct 17 2006 %E A114206 More terms from _Ray Chandler_ and _Hans Havermann_, Oct 18 2006 %E A114206 Edited by _Andrei Zabolotskii_ and _Kevin Ryde_, Jul 20 2025