A089641 Number of k, 1<=k<=n, such that the number of elements in the continued fraction for n/k is maximum.
1, 2, 1, 1, 1, 2, 2, 1, 2, 2, 2, 1, 1, 2, 1, 2, 4, 2, 2, 3, 1, 4, 2, 5, 3, 3, 2, 2, 2, 1, 2, 2, 4, 1, 2, 4, 2, 4, 1, 1, 4, 1, 2, 2, 3, 2, 2, 1, 2, 2, 4, 2, 4, 8, 1, 1, 5, 2, 4, 2, 8, 6, 5, 2, 1, 2, 2, 3, 2, 3, 4, 1, 3, 1, 2, 2, 7, 5, 2, 1, 2, 2, 2, 8, 2, 2, 4, 2, 1, 5, 2, 4, 4, 4, 2, 6, 2, 8, 2, 6, 6, 1, 2, 2, 2
Offset: 1
Keywords
Crossrefs
Cf. A084242.
Programs
-
PARI
a(n)=sum(s=1,n,if(length(contfrac(n/s))-vecmax(vector(n,i,length(contfrac(n/i)))),0,1))