login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A339267 Level of the Calkin-Wilf tree in which the n-th convergent of the continued fraction for e appears. 0
2, 3, 5, 6, 7, 11, 12, 13, 19, 20, 21, 29, 30, 31, 41, 42, 43, 55, 56, 57, 71, 72, 73, 89, 90, 91, 109, 110, 111, 131, 132, 133, 155, 156, 157, 181, 182, 183, 209, 210, 211, 239, 240, 241, 271, 272, 273, 305, 306, 307, 341, 342, 343, 379, 380, 381, 419, 420, 421, 461 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
The depth level of a rational in the Calkin-Wilf tree is the sum of its continued fraction terms, with the root (1/1) as level 1 for this purpose. So the present sequence is partial sums of the continued fraction terms of e (A003417). Depth levels are the same in the related trees Stern-Brocot, Bird, etc. - Kevin Ryde, Dec 26 2020
LINKS
Wikipedia, Calkin-Wilf Tree.
FORMULA
a(n) = a(n-1) + 2*a(n-3) - 2*a(n-4) - a(n-6) + a(n-7) for n > 7.
a(n) = floor(n/3)^2 + n + 1. - Kevin Ryde, Dec 26 2020
G.f.: x*(2 + x + 2*x^2 - 3*x^3 - x^4 + x^6)/((1 - x)^3*(1 + x + x^2)^2). - Stefano Spezia, Dec 27 2020
EXAMPLE
a(1) = 2 since 1st convergent 2, to e, appears at level 2 of the Calkin-Wilf tree.
a(2) = 3 since 2nd convergent 3 appears at level 3, a(3) = 5 since 3rd convergent 8/3 appears at level 5.
MATHEMATICA
children[{a_, b_}]:={{a, a+b}, {a+b, b}};
frac[{a_, b_}]:=a/b;
L[1]={{1, 1}};
L[n_]:=Flatten[Map[children, L[n-1]], 1];
CWLevel[n_]:=Map[frac, If[n==1, L[1], Complement[L[n], L[n-1]]]];
WhereCW[{a0_, b0_}]:=Module[{a=a0, b=b0, steps}, steps =1; While[a>1 || b>1, {a, b}=parent[{a, b}]; steps++]; steps];
fracpair[k_]:={Numerator[FromContinuedFraction[ContinuedFraction[E, k]]], Denominator[FromContinuedFraction[ContinuedFraction[E, k]]]};
Table[WhereCW[fracpair[k]], {k, 1, 60}]
PROG
(PARI) a(n) = sqr(n\3) + n + 1; \\ Kevin Ryde, Dec 26 2020
CROSSREFS
Cf. A002487, A003417 (continued fraction for e), A007676/A007677 (convergents).
Sequence in context: A198191 A243058 A348440 * A288863 A121700 A080980
KEYWORD
nonn,easy
AUTHOR
Gary E. Davis, Nov 29 2020
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 9 15:13 EDT 2024. Contains 372352 sequences. (Running on oeis4.)