Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #26 Feb 12 2019 09:25:14
%S 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,
%T 27,28,29,30,200,77706,16532869712,3230579689970657935732,
%U 36802906522516375115639735990520502954652700
%N a(n+1) is the smallest number greater than a(n) such that Sum_{j=1..n+1} 1/a(j) <= 4, a(1) = 1.
%C 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).
%C A140335 is the same sequence for 3. The sequence for 5 consists of 99 terms, the largest of which has 142548 digits.
%D 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.
%H John Scholes, <a href="http://mks.mff.cuni.cz/kalva/putnam/psoln/psol5413.html">14th Putnam Mathematical Competition, 1954, Problem B6</a>, after Gleason, Greenwood & Kelly.
%H <a href="/index/Ed#Egypt">Index entries for sequences related to Egyptian fractions</a>
%F Sum_{k=1..35} 1/a(k) = 4.
%t x0=4-Sum[1/k,{k,1,30}];
%t Nm=10;
%t j=0;
%t While[x0>0||j==Nm,a0=Ceiling[1/x0];
%t x0=x0-1/a0;
%t Print[a0];j++]
%t 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 *)
%o (Python)
%o from sympy import egyptian_fraction
%o print(egyptian_fraction(4)) # _Pontus von Brömssen_, Feb 10 2019
%Y Cf. A140335, A306349.
%K nonn,fini,full
%O 1,2
%A _Yuriy Sibirmovsky_, Jan 31 2017