# Variation On Harmonic Series Approximates Log

Robert Israel israel at math.ubc.ca
Mon Jul 14 00:58:29 CEST 2008

```
On Sun, 13 Jul 2008, Leroy Quet wrote:

> Could someone please calculate more terms of this sequence? I wonder if it is already in the EIS. (I may have made a mistake with my terms.)
>
> Each a(n) is the (+ or -) integer, given the earlier terms of the sequence, such that sum{k=1 to n} a(k)/k is the best approximation to the natural log of n.
>
> In other words, a(n) = the nearest integer to
> n*(ln(n) - sum{k=1 to n-1} a(k)/k).
>
> I get that the sequence begins:
>
> 0,1,2,1,1,1,1,1,1,1,1,2,
>
> When, if ever, does the sequence become negative?
>
> Thanks,
> Leroy Quet

I get
0, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
...

where a[3], a[12] and a[164] are 2, and all the other a[n] for 2 <= n <=
4000 are 1.

Cheers,
Robert Israel

```