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.

Original entry on oeis.org

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

Views

Author

Robin Powell, Mar 15 2019

Keywords

Comments

a(n) is the least k such that (k-1/2)^n < n!. - Robert Israel, May 05 2019

Examples

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

Crossrefs

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

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