A260375 Numbers k such that A260374(k) is a perfect square.
0, 1, 2, 4, 5, 6, 7, 8, 10, 11, 14, 15, 16
Offset: 1
Examples
6! = 720. The nearest perfect square is 729. The difference is 9, which is itself a perfect square. So, 6 is in this sequence.
Programs
-
PARI
is(n)=my(N=n!,s=sqrtint(N)); issquare(min(N-s^2, (s+1)^2-N)) \\ Charles R Greathouse IV, Jul 23 2015
-
Python
from gmpy2 import isqrt, is_square A260375_list, g = [0], 1 for i in range(1, 1001): g *= i s = isqrt(g) t = g-s**2 if is_square(t if t-s <= 0 else 2*s+1-t): A260375_list.append(i) # Chai Wah Wu, Jul 23 2015
Comments