OFFSET
1,3
COMMENTS
a(n) + b(n) = n and as n -> +infinity, a(n) / b(n) converges to e. For all n, a(n) / b(n) < e.
FORMULA
a(1) = 0. b(n) = n - a(n). If (a(n) + 1) / b(n) < e, then a(n+1) = a(n) + 1, else a(n+1) = a(n).
a(n) = floor(n*exp(1)/(exp(1)+1)). - Vladeta Jovovic, Oct 04 2003
EXAMPLE
a(6)= 4 so b(6) = 6 - 4 = 2. a(7) = 5 because (a(6) + 1) / b(6) = 5/2 which is < e. So b(7) = 7 - 5 = 2. a(8) = 5 because (a(7) + 1) / b(7) = 6/2 which is not < e.
PROG
(PARI) a(n)=local(t); if(n<2, 0, t=0; for(k=0, n-1, if(1+t<exp(1)*(k-t), t++)); t)
CROSSREFS
KEYWORD
easy,frac,nonn
AUTHOR
Robert A. Stump (bee_ess107(AT)msn.com), Oct 18 2002
STATUS
approved