login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A378568
Lowest weight of rational fraction with denominator n.
0
1, 2, 3, 2, 4, 2, 5, 2, 3, 2, 6, 2, 6, 2, 3, 2, 7, 2, 7, 2, 3, 2, 8, 2, 4, 2, 3, 2, 8, 2, 8, 2, 3, 2, 4, 2, 9, 2, 3, 2, 9, 2, 9, 2, 3, 2, 9, 2, 5, 2, 3, 2, 10, 2, 4, 2, 3, 2, 10, 2, 10, 2, 3, 2, 4, 2, 10, 2, 3, 2, 10, 2, 10, 2, 3, 2, 5, 2, 10, 2, 3, 2, 11, 2
OFFSET
1,2
COMMENTS
The weight wt(x) of a rational number x is defined to be the sum of the partial quotients in the continued fraction expansion of x. For example, 5/14 = [0,2,1,4], so wt(5/14) = 7. Here a(n) is the minimum, over all m, 1<=m<n, of wt(m/n).
It is conjectured by Kravitz and Sah that a(n) = O(log n).
LINKS
N. Kravitz and A. Sah, Linear extension numbers of n-element posets, Order 38 (2021), 49-66.
M. Shrader-Frechette, Modified Farey sequences and continued fractions, Math. Magazine 54 (1991), 60-63.
EXAMPLE
For n = 23, we have a(23) = 8 because 5/23 = [0,4,1,1,2] with weight 8, and this is the smallest over all fractions m/23 with 1<=m<23.
PROG
(PARI) a(n)=if(n==1, return(1)); my(r=oo, t); for(m=1, n-1, t=vecsum(contfrac(m/n)); if(t<r, r=t)); r \\ Charles R Greathouse IV, Dec 01 2024
CROSSREFS
Sequence in context: A162322 A336155 A196930 * A305437 A111982 A323236
KEYWORD
nonn,new
AUTHOR
Jeffrey Shallit, Dec 01 2024
STATUS
approved