OFFSET
0,3
COMMENTS
For any fixed real value x > 0 let u(1) = 1 and u(n) = u(n-1) - x*sign(u(n-1))/n. Then the series S(x) = Sum_{k>=1} u(k) converges and has value S(x) = x*floor(exp(1/x + gamma - 1)) - x - 1 where gamma = 0.5772... is the Euler gamma constant. Thus for n >= 0 a(n+1) = n*S(1/n) + n + 1.
From Gerhard Kirchner, May 02 2020: (Start)
It is interesting to compare T(x)=exp(x-gamma) and G(x)=[T(x)] with F(x)= index k of the harmonic sequence H(k) such that H(k) is closest to x. More exactly: For H(k-1)<x<=H(k), F(x)=k-1 if x<x1, and F(x)=k if x>=x1, where x1=H(k)-1/(2k) is the point of dicontinuity. Harmonic sequence: H(0)=0 and H(k)=H(k-1)+1/k for k>0 with the asymptotic formula H(k)=log(k)+gamma+1/(2k)-1/(12k^2)+O(1/k^4).
G(x) has a point of dicontinuity x2=x1+1/(12k^2), which can be derived from T(x2)=k and the asymptotic formula. Within the "critical" section x1<x<x2, F(x)=G(x)+1, and F(x)=G(x) outside. No n<=200 lies in a critical section (checked), i.e., F(n)=G(n)=a(n) for n<=200.
What about n>200? Let x1<n<x2 with T(x1)<T(n)<T(x2)=k. T(x1)=T(x2)*exp(-1/(12k^2)), which is asymptotically equal to k-1/(12k). With k=T(x2)=ceiling(T(n)): ceiling(T(n))-T(n)<1/(12*T(n)).
Regarding the difference as a random number between 0 and 1 and considering the exponential increase of T(n), it is unlikely that any n is located in a critical section.
(End)
PROG
(PARI) a(n)=if(n<0, 0, floor(exp(n-Euler)))
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Michael Somos, Nov 20 2002
STATUS
approved