A245222 Continued fraction expansion of the constant c in A245221; c = sup{f(n,1)}, where f(1,x) = x + 1 and thereafter f(n,x) = x + 1 if n is in A022838, else f(n,x) = 1/x.
2, 1, 2, 1, 1, 2, 1, 1, 2, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 2, 1, 1, 2, 1, 1, 2, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 2, 1, 1, 2, 1, 1, 2, 1, 2, 1, 1, 2, 1
Offset: 0
Examples
c = 2.7207664507294752975469517348171513242... ; the first 12 numbers f(n,1) comprise S(12) = {1, 2, 1/2, 3/2, 2/3, 5/3, 8/3, 3/8, 11/8, 8/11, 19/11, 11/19}; max(S(12)) = 8/3, with continued fraction [2,1,2]. From _M. F. Hasler_, Feb 06 2025: (Start) Illustration of the "multiple of sqrt(3)" comment: n: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 x: 0 1 1.73 2 3 3.46 4 5 5.20 6 6.93 7 8 8.66 9 10 m: 1 0 1 0 0 1 0 0 1 0 1 0 0 1 0 0 Here, x lists the elements of N U N*sqrt(3), and m = 1 if x == 0 (mod sqrt(3)), i.e., x is an integer multiple of sqrt(3). The sequence a(n) is m + 1. (End)
Links
- G. C. Greubel, Table of n, a(n) for n = 0..1999
Crossrefs
Programs
-
Mathematica
tmpRec = $RecursionLimit; $RecursionLimit = Infinity; u[x_] := u[x] = x + 1; d[x_] := d[x] = 1/x; r = Sqrt[3]; w = Table[Floor[k*r], {k, 2000}]; s[1] = 1; s[n_] := s[n] = If[MemberQ[w, n - 1], u[s[n - 1]], d[s[n - 1]]]; max = Max[N[Table[s[n], {n, 1, 3000}], 200]] (* A245221 *) ContinuedFraction[max, 120] (* A245222 *)
-
PARI
/* illustration of the comment related to sqrt(3)*/ [1+(abs(x-x\/s*s)<1e-9) | x<-Set(concat(Col([1.,s=sqrt(3)]~*[0..99])))[1..99] ] \\ M. F. Hasler, Feb 06 2025
Formula
a(n) = 2 - A144612(n) for all n > 0. - M. F. Hasler, Feb 06 2025
Extensions
Offset changed by Andrew Howroyd, Aug 08 2024
Comments