A364200 Minimal number of terms of mixed-sign Egyptian fraction f such that H(n) + f is an integer, where H(n) is the n-th harmonic number.
0, 1, 1, 1, 2, 2, 3, 3, 3, 2, 2, 3, 4, 3, 4, 4, 4, 4, 4, 5, 5, 4, 5, 5, 5, 4, 5, 5, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6
Offset: 1
Examples
For n=10: H(10) = 7381/2520 = 2.928...; H(10) - floor(H(10)) = 7381/2520 - 2 = 2341/2520 = 1/2 + 1/7 + 1/8 + 1/9 + 1/20, which cannot be expressed as the sum of fewer than 5 reciprocals, and ceiling(H(10)) - H(10) = 3 - 7381/2520 = 179/2520 = 1/30 + 1/42 + 1/72, which cannot be expressed as the sum of fewer than 3 reciprocals, so A363937(10) = 3. But 179/2520 = 1/14 - 1/2520 (a "mixed-sign Egyptian fraction"), so a(10) = 2.
Links
- Ron Knott, Egyptian Fractions
Crossrefs
Cf. A363937.
Programs
-
Mathematica
check[f_, k_] := (If[Numerator@f == 1, Return@True]; If[k == 1, Return@False]; Catch[Do[If[check[f - 1/i, k - 1], Throw@True], {i, Range[Ceiling[1/f], Floor[k/f]]}]; Throw@False]); checkMixed[f_, k_, m_] := If[m == 1, Catch[Do[If[check[1/i - f, k], Throw@True], {i, Range[2, Floor[1/f]]}]; Throw@False], checkMixed[f, k, m - 1]]; a[n_] := (h = HarmonicNumber[n]; d = Min[h - Floor@h, Ceiling@h - h]; j = 1; While[Not@check[d, j], j++]; res = j; Do[ If[checkMixed[d, i - m, m], res = i], {i, 2, j - 1}, {m, 1, i - 1}]; res);
Formula
a(n) <= A363937(n).
Comments