login
a(n) = denominator of b(n): b(n) = the minimum possible value for a continued fraction whose terms are a permutation of the terms of the simple continued fraction for H(n) = sum{k=1 to n} 1/k, the n-th harmonic number.
4

%I #21 Mar 21 2017 04:14:33

%S 1,2,6,12,79,22,187,369,4343,4220,67223,38067,535331,772210,476254,

%T 1020589,15631362,4294584,116606407,22970156,5737508,6936929,

%U 185961619,290508289,13765708850,10898842249,77379962122,91973292918,1858284737854,2220029652331

%N a(n) = denominator of b(n): b(n) = the minimum possible value for a continued fraction whose terms are a permutation of the terms of the simple continued fraction for H(n) = sum{k=1 to n} 1/k, the n-th harmonic number.

%H Alois P. Heinz, <a href="/A129085/b129085.txt">Table of n, a(n) for n = 1..750</a>

%e The continued fraction for H(5) = 137/60 is [2;3,1,1,8]. The minimum value a continued fraction can have with these same terms in some order is [1;8,1,3,2] = 88/79.

%p with(numtheory):

%p H:= proc(n) option remember; `if`(n=1, 1, H(n-1)+1/n) end:

%p r:= proc(l) local j; infinity;

%p for j from nops(l) to 1 by -1 do l[j]+1/% od

%p end:

%p hs:= proc(l) local ll, h, s, m; ll:= []; h:= nops(l); s:= 1; m:= s; while s<=h do ll:= [ll[],l[m]]; if m=h then h:= h-1; m:= s else s:= s+1; m:= h fi od; ll end:

%p a:= n-> denom(r(hs(sort(cfrac(H(n), 'quotients'))))):

%p seq(a(n), n=1..40); # _Alois P. Heinz_, Aug 04 2009

%t r[l_] := Module[{lj, j}, For[lj = Infinity; j = Length[l], j >= 1, j--, lj = l[[j]] + 1/lj]; lj];

%t hs[l_] := Module[{ll, h, s, m}, ll = {}; h = Length[l]; s = 1; m = s; While[s <= h, ll = Append[ll, l[[m]]]; If[m == h, h--; m = s, s++; m = h ]]; ll];

%t a[n_] := Denominator[ r[ hs[ Sort[ ContinuedFraction[ HarmonicNumber[n]]]]] ];

%t Table[a[n], {n, 1, 40}] (* _Jean-François Alcover_, Mar 20 2017, after _Alois P. Heinz_ *)

%Y Cf. A129082, A129083, A129084.

%K frac,nonn

%O 1,2

%A _Leroy Quet_, Mar 28 2007

%E More terms from _Diana L. Mecum_, Jun 16 2007

%E Extended beyond a(12) _Alois P. Heinz_, Aug 04 2009