OFFSET
1,2
COMMENTS
a(n) also equals the smallest positive integer such that lcm(a(1), a(2), a(3), ... a(n)) = n!, for every positive integer n. - Leroy Quet, Apr 28 2007
LINKS
T. D. Noe, Table of n, a(n) for n = 1..500
FORMULA
a(n) = Product_{p|n} p^(sum{k >= 1} floor(n/p^k)), where the product runs over the distinct primes p that divide n. - Leroy Quet, Apr 28 2007
a(n) = n*A062763(n). - R. J. Mathar, Mar 11 2017
a(n) = (numerator of B(n, 1/n))/n^(n - 1), where B(.,.) is the Euler beta function. - Arkadiusz Wesolowski, Nov 22 2017
a(p) = p for p prime. - Peter Luschny, Nov 29 2017
EXAMPLE
a(4) = 8 since 4! = 24 and 4^4 = 256 and gcd(24, 256) = 8.
lcm(a(1), a(2), a(3), a(4), a(5), a(6)) = lcm(1, 2, 3, 8, 5, 144) = 6! = 720. (See comment.)
MAPLE
seq(igcd(n!, n^n), n=1..35); # Peter Luschny, Nov 29 2017
MATHEMATICA
Table[GCD[n!, n^n], {n, 40}] (* Harvey P. Dale, Oct 20 2011 *)
(* Alternative: *)
Table[Numerator@Beta[n, 1/n]/n^(n - 1), {n, 35}] (* Arkadiusz Wesolowski, Nov 22 2017 *)
PROG
(Python)
from sympy import factorint
from sympy.ntheory.factor_ import digits
def A051696(n):
c = 1
for p, e in factorint(n).items():
c *= p**min(e*n, (n-sum(digits(n, p)[1:]))//(p-1))
return c # Chai Wah Wu, May 02 2026
(PARI) a(n) = gcd(n!, n^n); \\ Bruce Nye, Jun 23 2026
CROSSREFS
KEYWORD
nonn,easy,nice,changed
AUTHOR
EXTENSIONS
More terms from James Sellers, Dec 08 1999
STATUS
approved
