cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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

This page as a plain text file.
%I A306904 #43 Jun 07 2025 13:04:23
%S A306904 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 A306904 12,13,13,14,14,14,15,15,15,16,16,17,17,17,18,18,18,19,19,19,20,20,21,
%U A306904 21,21,22,22,22,23,23,24,24,24,25,25,25
%N A306904 The geometric mean of the first n integers, rounded to the nearest integer.
%C A306904 a(n) is the least k such that (k-1/2)^n < n!. - _Robert Israel_, May 05 2019
%H A306904 Robert Israel, <a href="/A306904/b306904.txt">Table of n, a(n) for n = 1..10000</a>
%F A306904 a(n) = round(n!^(1/n)).
%F A306904 a(n) ~ n/e + log(n)/(2*e). - _Robert Israel_, May 05 2019
%e A306904 a(5) is the 5th root of the product of the first 5 integers (approx. 2.605171) rounded up to 3.
%p A306904 Res:= 1: last:= 1: v:= 1:
%p A306904 for n from 2 to 100 do
%p A306904   v:= n*v; t:= 2^n*v;
%p A306904   for k from last while (2*k-1)^n < t do od:
%p A306904   last:= k-1;
%p A306904   Res:= Res, last;
%p A306904 od:
%p A306904 Res; # _Robert Israel_, May 05 2019
%t A306904 Array[Round[#!^(1/#)] &, 68] (* _Michael De Vlieger_, Mar 31 2019 *)
%t A306904 Table[Round[GeometricMean[Range[n]]],{n,70}] (* _Harvey P. Dale_, Mar 19 2023 *)
%o A306904 (PARI) a(n) = round(n!^(1/n)); \\ _Michel Marcus_, May 05 2019
%o A306904 (Python)
%o A306904 from sympy import integer_nthroot, factorial
%o A306904 def A306904(n): return (m:=int(integer_nthroot(f:=int(factorial(n)),n)[0]))+int((f<<n)>=((m<<1)+1)**n) # _Chai Wah Wu_, Jun 06 2025
%Y A306904 Cf. A000142, A061375 (floor instead of round), A214046.
%K A306904 nonn
%O A306904 1,3
%A A306904 _Robin Powell_, Mar 15 2019
%E A306904 Corrected by _Robert Israel_, May 05 2019