OFFSET
1,1
COMMENTS
The original definition was: Nearest integer to Sum[(10^n-i)/i,{i,1,10^n/2}]/(10^n/2), but this was simplified to the present definition by Jon E. Schoenfield, Aug 05 2008.
LINKS
Jon E. Schoenfield, Table of n, a(n) for n = 1..1000
FORMULA
a(n) = round(2 * (log(m) + Gamma) + 1/m - ...) - 1 where m = 10^n / 2 and Gamma = 0.57721566490153286... (the Euler-Mascheroni constant A001620). - Jon E. Schoenfield, Aug 05 2008
EXAMPLE
a(1)=4 because round((9/1 + 8/2 + 7/3 + 6/4 + 5/5)/5) is 4.
a(2)=8 because round((99/1 + 98/2 + ... + 50/50))/50 is 8.
MAPLE
for i from 10 to 11 by 2 do s:=0; t:=0; for d from i/2 to i -1 do s:= s + (d / (i - d)); t:= t +1; end do; print(round((s / t))); end do;
MATHEMATICA
Table[Round[-1 + 2*HarmonicNumber[Floor[10^n/2]]], {n, 1, 50}] (* G. C. Greubel, Aug 31 2018 *)
PROG
(PARI) a(n)={ my(i, a=0); for(i=1, 10^n/2, a += 1/i); return(round(2*a-1)); }
main(size)={return(vector(size, m, a(m))); } /* Anders Hellström, Jul 12 2015 */
CROSSREFS
KEYWORD
nonn
AUTHOR
Ben Paul Thurston, Mar 27 2007
EXTENSIONS
Extended and edited by John W. Layman, Jul 10 2007
Terms from a(11) onwards from Jon E. Schoenfield, Aug 05 2008
STATUS
approved