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 A317414 #32 Aug 04 2024 12:45:15 %S A317414 0,2,4,8,1,3,2,531440,1,1,3,1,8,4,2, %T A317414 22528399544939174411840147874772640,1,1,4,8,1,3,1,1,531440,2,3,1,8,4, %U A317414 2 %N A317414 Continued fraction for ternary expansion of Liouville's number interpreted in base 3 (A012245). %C A317414 The continued fraction of the number obtained by reading A012245 as a ternary fraction. %C A317414 Except for the first term, the only values that occur in this sequence are 1,2,3,4, and values 3^((m-1)*m!)-1 for m > 1. The probability of occurrence P(a(n) = k) are given by: %C A317414 P(a(n) = 1) = 3/8, %C A317414 P(a(n) = 2) = 1/8, %C A317414 P(a(n) = 3) = 1/8, %C A317414 P(a(n) = 4) = 1/8 and %C A317414 P(a(n) = 3^((m-1)*m!)-1) = 2^-(m+1) for m > 1. %C A317414 More generally it seems that for any base > 2, P(a(n) <= base+1) = 3/4, P(a(n) > base+1) = 1/4, and P(a(n) = base^((m-1)*m!)-1) = 2^-(m+1) for m > 1. %H A317414 A.H.M. Smeets, <a href="/A317414/b317414.txt">Table of n, a(n) for n = 0..62</a> %F A317414 a(n) = 1 if and only if n in {floor(8*n/3) + A317627(n) | n > 0}. %F A317414 a(n) = 2 if and only if n in {8*n - 10 + 3*A089013(n-1) | n > 0}. %F A317414 a(n) = 3 if and only if n in {16*n - 11 | n > 0} union {16*n - 6 | n > 0}. %F A317414 a(n) = 4 if and only if n in {16*n - 14 | n > 0} union {16*n - 3 | n > 0}. %F A317414 a(n) = 3^((m-1)*m!)-1 iff n in {2^m*(1+k*4) - 1 | k >= 0} union {2^m*(3+k*4) | k >= 0} for m > 1. %p A317414 with(numtheory): cfrac(add(1/3^factorial(n),n=1..7),30,'quotients'); # _Muniru A Asiru_, Aug 11 2018 %t A317414 ContinuedFraction[ FromDigits[ RealDigits[ Sum[1/10^n!, {n, 8}], 10, 10000], 3], 60] (* _Robert G. Wilson v_, Aug 09 2018 *) %o A317414 (Python) %o A317414 n,f,i,p,q,base = 1,1,0,0,1,3 %o A317414 while i < 100000: %o A317414 i,p,q = i+1,p*base,q*base %o A317414 if i == f: %o A317414 p,n = p+1,n+1 %o A317414 f = f*n %o A317414 n,a,j = 0,0,0 %o A317414 while p%q > 0: %o A317414 a,f,p,q = a+1,p//q,q,p%q %o A317414 print(a-1,f) %Y A317414 Cf. A012245, A089013, A317627. %Y A317414 Cf. A058304 (in base 10), A317413 (in base 2), A317661 (in base 4). %K A317414 nonn,cofr %O A317414 0,2 %A A317414 _A.H.M. Smeets_, Jul 27 2018