total2 = 0; max_total = 0; for n=1:1000 for i=1:n, total2 = total2 +(1/i); end, if total2 < 5, total2 n end, total2 = 0; end,