login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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

%I #21 Sep 22 2023 05:29:58

%S 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,

%T 5,5,5,5,5,6,6,6

%N 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.

%C For H(n) - floor(H(n)) and ceiling(H(n)) - H(n), the shortest mixed-sign Egyptian fractions are calculated, and the smaller length of fractions is selected.

%C Similar to A106394 and A224820. But those sequences use the greedy algorithm, which does not guarantee the shortest length of expansion.

%C For 1 < n < 41, a(n) < A363937(n) only for n = 10 and n = 22.

%H Ron Knott, <a href="https://r-knott.surrey.ac.uk/Fractions/egyptian.html">Egyptian Fractions</a>

%F a(n) <= A363937(n).

%e 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.

%e But 179/2520 = 1/14 - 1/2520 (a "mixed-sign Egyptian fraction"), so a(10) = 2.

%t check[f_, k_] := (If[Numerator@f == 1, Return@True];

%t If[k == 1, Return@False];

%t Catch[Do[If[check[f - 1/i, k - 1], Throw@True],

%t {i, Range[Ceiling[1/f], Floor[k/f]]}];

%t Throw@False]);

%t checkMixed[f_, k_, m_] := If[m == 1,

%t Catch[Do[If[check[1/i - f, k], Throw@True],

%t {i, Range[2, Floor[1/f]]}];

%t Throw@False],

%t checkMixed[f, k, m - 1]];

%t a[n_] := (h = HarmonicNumber[n];

%t d = Min[h - Floor@h, Ceiling@h - h];

%t j = 1;

%t While[Not@check[d, j], j++];

%t res = j;

%t Do[

%t If[checkMixed[d, i - m, m], res = i],

%t {i, 2, j - 1}, {m, 1, i - 1}];

%t res);

%Y Cf. A363937.

%K nonn,more

%O 1,5

%A _Denis Ivanov_, Jul 13 2023

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 14 02:38 EDT 2024. Contains 374291 sequences. (Running on oeis4.)