A306904 The geometric mean of the first n integers, rounded to the nearest integer.
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, 12, 13, 13, 14, 14, 14, 15, 15, 15, 16, 16, 17, 17, 17, 18, 18, 18, 19, 19, 19, 20, 20, 21, 21, 21, 22, 22, 22, 23, 23, 24, 24, 24, 25, 25, 25
Offset: 1
Keywords
Examples
a(5) is the 5th root of the product of the first 5 integers (approx. 2.605171) rounded up to 3.
Links
- Robert Israel, Table of n, a(n) for n = 1..10000
Programs
-
Maple
Res:= 1: last:= 1: v:= 1: for n from 2 to 100 do v:= n*v; t:= 2^n*v; for k from last while (2*k-1)^n < t do od: last:= k-1; Res:= Res, last; od: Res; # Robert Israel, May 05 2019
-
Mathematica
Array[Round[#!^(1/#)] &, 68] (* Michael De Vlieger, Mar 31 2019 *) Table[Round[GeometricMean[Range[n]]],{n,70}] (* Harvey P. Dale, Mar 19 2023 *)
-
PARI
a(n) = round(n!^(1/n)); \\ Michel Marcus, May 05 2019
-
Python
from sympy import integer_nthroot, factorial def A306904(n): return (m:=int(integer_nthroot(f:=int(factorial(n)),n)[0]))+int((f<
=((m<<1)+1)**n) # Chai Wah Wu, Jun 06 2025
Formula
a(n) = round(n!^(1/n)).
a(n) ~ n/e + log(n)/(2*e). - Robert Israel, May 05 2019
Extensions
Corrected by Robert Israel, May 05 2019
Comments