OFFSET
1,2
COMMENTS
Observation: for n < 2000, only for n = 1, 4, 5, 6, 7, 8, 9, 10, 11, 13, 14, 15, 16 is a(n) a square (see A360210).
According to my conjecture that n! + n^2 != m^2 for n >= 1, m >= 0 (see A004664), for all terms: a(n) != n^2. - Alexander R. Povolotsky, Oct 06 2008
There are two cases: a(n) > sqrt(n!) in A182203 and a(n) < sqrt(n!) in A182204. - Artur Jasinski, Apr 13 2012
LINKS
T. D. Noe, Table of n, a(n) for n=1..100
FORMULA
a(n) <= A038202(n)^2, with equality for the n listed in the first comment. - M. F. Hasler, Apr 01 2012
EXAMPLE
a(6) = 9 as 6! + 9 = 729 is a square.
MATHEMATICA
Table[ Ceiling[ Sqrt[n! ]]^2 - n!, {n, 1, 28}]
PROG
(PARI) A068869(n)=(sqrtint(n!-1)+1)^2-n! \\ M. F. Hasler, Apr 01 2012
(Python)
from math import factorial, isqrt
def a(n): return (isqrt((f:=factorial(n))-1)+1)**2 - f
print([a(n) for n in range(1, 30)]) # Michael S. Branicky, Jan 30 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Amarnath Murthy, Mar 13 2002
EXTENSIONS
More terms from Vladeta Jovovic, Mar 21 2002
Edited by Robert G. Wilson v and N. J. A. Sloane, Mar 22 2002
STATUS
approved