OFFSET
1,2
COMMENTS
The method for any number A is to find the largest harmonic number H(n) smaller than A, then use the greedy algorithm to expand the difference A - H(n).
A140335 is the same sequence for 3. The sequence for 5 consists of 99 terms, the largest of which has 142548 digits.
REFERENCES
A. M. Gleason, R. E. Greenwood, and L. M. Kelly, The William Lowell Putnam Mathematical Competition, Problems and Solutions, 1938-1964, MAA, 1980, pages 398-399.
LINKS
John Scholes, 14th Putnam Mathematical Competition, 1954, Problem B6, after Gleason, Greenwood & Kelly.
FORMULA
Sum_{k=1..35} 1/a(k) = 4.
MATHEMATICA
x0=4-Sum[1/k, {k, 1, 30}];
Nm=10;
j=0;
While[x0>0||j==Nm, a0=Ceiling[1/x0];
x0=x0-1/a0;
Print[a0]; j++]
f[s_List, n_] := Block[{t = Total[1/s]}, Append[s, Max[ s[[-1]] +1, Ceiling[1/(n - t)]]]]; Nest[f[#, 4] &, {1}, 34] (* Robert G. Wilson v, Feb 05 2017 *)
PROG
(Python)
from sympy import egyptian_fraction
print(egyptian_fraction(4)) # Pontus von Brömssen, Feb 10 2019
CROSSREFS
KEYWORD
nonn,fini,full
AUTHOR
Yuriy Sibirmovsky, Jan 31 2017
STATUS
approved