%I #12 Apr 08 2015 14:14:15
%S 1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,4,5,5,5,5,5,6,6,6,6,6,7,7,7,7,7,8,8,
%T 8,8,8,8,9,9,9,9,9,10,10,10,10,10,10,11,11,11,11,11,11,12,12,12,12,12,
%U 12,13,13,13,13,13,13,14,14,14,14,14,14,15,15
%N Least k such that 1/k <= mean of {1, 1/2, 1/3,..., 1/n}.
%C Largest integer not exceeding the harmonic mean of the first n numbers.
%H Clark Kimberling, <a href="/A226762/b226762.txt">Table of n, a(n) for n = 1..1000</a>
%F a(n) = floor(n/{sum{1/k, k = 1..n}).
%e 1/3 < mean{1,1/2,1/3,...,1/9} < 1/4, so that a(9) = 3.
%t f[n_] := Mean[Table[1/k, {k, 1, n}]]
%t Table[Floor[1/f[n]], {n, 1, 120}] (* A226762 *)
%t Table[Ceiling[1/f[n]], {n, 1, 120}] (* A226763 *)
%o (PARI) \\ This uses only precision-independent integer operations:
%o a(n)=(n*n!)\sum(k=1,n,n!\k) \\ - _Stanislav Sykora_, Apr 08 2015
%Y Cf. A226763, A256502.
%K nonn,easy
%O 1,5
%A _Clark Kimberling_, Jun 19 2013
|