OFFSET
1,4
COMMENTS
Difference between central divisors of n!. - Jaume Oliver Lafont, Mar 13 2009
For n > 1, n! will never be a square, because of primes in the last half of the factors. Therefore the divisors of n! come in pairs (x,y) with x*y = n! and x < y. The sequence gives the difference y-x between the pair nearest to the square root of n!. - Alois P. Heinz, Jul 06 2009
a(n) = 2 iff n belongs to A146968. - Max Alekseyev, Feb 06 2010
LINKS
Max Alekseyev, Table of n, a(n) for n = 1..140
FORMULA
EXAMPLE
2! = 1*2, with difference of 1.
3! = 2*3, with difference of 1.
4! = 4*6, with difference of 2.
5! = 10*12, with difference of 2.
6! = 24*30, with difference of 6.
7! = 70*72 with difference of 2.
MAPLE
A060777 := proc(n) local d, nd ; d := sort(convert(numtheory[divisors](n!), list)) ; nd := nops(d) ; op(floor(1+nd/2), d) ; end:
A060776 := proc(n) local d, nd ; d := sort(convert(numtheory[divisors](n!), list)) ; nd := nops(d) ; op(floor(nd/2), d) ; end:
seq(A061057(n), n=2..27) ; # R. J. Mathar, Mar 14 2009
MATHEMATICA
Do[ With[ {k = Floor[ Sqrt[ x! ] ] - Do[ If[ Mod[ x!, Floor[ Sqrt[ x! ] ] - n ] == 0, Return[ n ] ], {n, 0, 10000000} ]}, Print[ {x, "! =", k, x!/k, x!/k - k} ] ], {x, 3, 22} ]
f[n_] := Block[{k = Floor@ Sqrt[n! ]}, While[ Mod[n!, k] != 0, k-- ]; n!/k - k]; Table[f@n, {n, 2, 32}] (* Robert G. Wilson v, Jul 11 2009 *)
Table[d=Divisors[n!]; len=Length[d]; If[OddQ[len], 0, d[[1 + len/2]] - d[[len/2]]], {n, 34}] (* Vincenzo Librandi, Jan 02 2016 *)
PROG
(PARI) for(k=2, 25, d=divisors(k!); print(d[#d/2+1]-d[#d/2])) \\ Jaume Oliver Lafont, Mar 13 2009
(Python)
from math import isqrt, factorial
from sympy import divisors
def A061057(n):
k = factorial(n)
m = max(d for d in divisors(k, generator=True) if d <= isqrt(k))
return k//m-m # Chai Wah Wu, Apr 06 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
Ed Pegg Jr, May 28 2001
EXTENSIONS
More terms from Dean Hickerson, Jun 13 2001
a(41) from Robert G. Wilson v, Oct 03 2014
STATUS
approved