OFFSET
0,3
FORMULA
a(n+1)/a(n) approaches e = exp(1) = 2.71828...
First differences of A002387. - Vladeta Jovovic, Jul 30 2004
EXAMPLE
The ceilings of the first several partial sums of the reciprocal of the positive integers are 1 2 2 3 3 3 3 3 3 3 4 4 and the series is monotonically increasing, so a(0) = 0 (there being no zero), a(1) = 1 (there being but one 1) and a(3) = 7 (there being seven 3s).
MATHEMATICA
fh[0] = 0; fh[1] = 1; fh[k_] := Module[{tmp}, If[ Floor[tmp = Log[k + 1/2] + EulerGamma] == Floor[tmp + 1/(24k^2)], Floor[tmp], UNKNOWN]]; a[0] = 1; a[1] = 2; a[n_] := Module[{val}, val = Round[Exp[n - EulerGamma]]; If[fh[val] == n && fh[val - 1] == n - 1, val, UNKNOWN]]; Table[ a[n + 1] - a[n], {n, 0, 27}] (* Robert G. Wilson v, Aug 05 2004 *)
PROG
(C)
int A096005(int k)
{ if(k<3) return k;
double sum = 0, n = 1; int ceiling = 2, cnt = 0;
for(;; ) {
sum += 1/n++;
if(sum < ceiling) { cnt++; continue; }
if(ceiling++ == k) return cnt; else cnt = 1; }
} /* Oskar Wieland, May 01 2014 */
CROSSREFS
KEYWORD
nonn
AUTHOR
W. Neville Holmes, Jul 29 2004
EXTENSIONS
More terms from Robert G. Wilson v, Aug 05 2004
STATUS
approved