login
The geometric mean of the first n integers, rounded to the nearest integer.
1

%I #33 Mar 19 2023 11:25:30

%S 1,1,2,2,3,3,3,4,4,5,5,5,6,6,6,7,7,8,8,8,9,9,9,10,10,11,11,11,12,12,

%T 12,13,13,14,14,14,15,15,15,16,16,17,17,17,18,18,18,19,19,19,20,20,21,

%U 21,21,22,22,22,23,23,24,24,24,25,25,25

%N The geometric mean of the first n integers, rounded to the nearest integer.

%C a(n) is the least k such that (k-1/2)^n < n!. - _Robert Israel_, May 05 2019

%H Robert Israel, <a href="/A306904/b306904.txt">Table of n, a(n) for n = 1..10000</a>

%F a(n) = round(n!^(1/n)).

%F a(n) ~ n/e + log(n)/(2*e). - _Robert Israel_, May 05 2019

%e a(5) is the 5th root of the product of the first 5 integers (approx. 2.605171) rounded up to 3.

%p Res:= 1: last:= 1: v:= 1:

%p for n from 2 to 100 do

%p v:= n*v; t:= 2^n*v;

%p for k from last while (2*k-1)^n < t do od:

%p last:= k-1;

%p Res:= Res, last;

%p od:

%p Res; # _Robert Israel_, May 05 2019

%t Array[Round[#!^(1/#)] &, 68] (* _Michael De Vlieger_, Mar 31 2019 *)

%t Table[Round[GeometricMean[Range[n]]],{n,70}] (* _Harvey P. Dale_, Mar 19 2023 *)

%o (PARI) a(n) = round(n!^(1/n)); \\ _Michel Marcus_, May 05 2019

%Y Cf. A000142, A061375 (floor instead of round), A214046.

%K nonn

%O 1,3

%A _Robin Powell_, Mar 15 2019

%E Corrected by _Robert Israel_, May 05 2019