OFFSET
0,4
FORMULA
a(n) = abs(n!-A260373(n)).
EXAMPLE
6!=720. The nearest perfect square is 729. The difference between these is 9, so a(6)=9.
PROG
(PARI) a(n)=abs(n!-round(sqrt(n!))^2) \\ Charles R Greathouse IV, Jul 23 2015
(Python)
from gmpy2 import isqrt
A260374_list, g = [0], 1
for i in range(1, 1001):
....g *= i
....s = isqrt(g)
....t = g-s**2
....A260374_list.append(int(t if t-s <= 0 else 2*s+1-t)) # Chai Wah Wu, Jul 23 2015
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved