A068869 Smallest number k such that n! + k is a square.
0, 2, 3, 1, 1, 9, 1, 81, 729, 225, 324, 39169, 82944, 176400, 215296, 3444736, 26167684, 114349225, 255004929, 1158920361, 11638526761, 42128246889, 191052974116, 97216010329, 2430400258225, 1553580508516, 4666092737476, 565986718738441, 2137864362693921
Offset: 1
Keywords
Examples
a(6) = 9 as 6! + 9 = 729 is a square.
Links
- T. D. Noe, Table of n, a(n) for n=1..100
Programs
-
Mathematica
Table[ Ceiling[ Sqrt[n! ]]^2 - n!, {n, 1, 28}]
-
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
Formula
a(n) <= A038202(n)^2, with equality for the n listed in the first comment. - M. F. Hasler, Apr 01 2012
Extensions
More terms from Vladeta Jovovic, Mar 21 2002
Edited by Robert G. Wilson v and N. J. A. Sloane, Mar 22 2002
Comments