A071647 a(n) is the maximum number of elements among the continued fractions for n/1, n/2, n/3, n/4, ..., n/n.
1, 1, 2, 2, 3, 2, 3, 4, 3, 3, 4, 4, 5, 4, 4, 4, 4, 5, 5, 4, 6, 4, 5, 4, 5, 5, 5, 5, 6, 6, 6, 5, 5, 7, 5, 5, 6, 5, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 7, 7, 6, 6, 6, 5, 8, 6, 6, 6, 6, 7, 6, 6, 6, 7, 7, 7, 7, 7, 7, 6, 7, 6, 7, 7, 7, 8, 6, 6, 8, 8, 8, 7, 7, 6, 7, 7, 7
Offset: 1
Examples
Continued fractions for 5/1 = [5]; 5/2 = [2, 2]; 5/3 = [1, 1, 2]; 5/4 = [1, 4]; 5/5 = [1]. Hence a(5) = 3.
Links
- Jinyuan Wang, Table of n, a(n) for n = 1..1000
Programs
-
Mathematica
a[n_] := Max[Table[Length[ContinuedFraction[n/k]], {k, 1, n}]]; Array[a, 100] (* Amiram Eldar, Apr 19 2025 *)
-
PARI
for(n=1,150,print1( vecmax(vector(n,i,length(contfrac(n/i)))),","))
Comments