A082995 Distance from n!+1 to next larger square.
2, 1, 2, 0, 0, 8, 0, 80, 728, 224, 323, 39168, 82943, 176399, 215295, 3444735, 26167683, 114349224, 255004928, 1158920360, 11638526760, 42128246888, 191052974115, 97216010328, 2430400258224, 1553580508515, 4666092737475
Offset: 1
Keywords
Examples
a(5)=0 because 5!+1 is a square. a(8)=80 because 8!+1 = 40321 and the next larger square is 40401, so 40401-40321 = 80.
Links
- Amiram Eldar, Table of n, a(n) for n = 1..808
- P. Leyland, Solutions to n!+1=m^2.
Programs
-
Mathematica
a[n_] := Ceiling @ Sqrt[(f = n! + 1)]^2 - f; Array[a, 27] (* Amiram Eldar, Dec 14 2019 *)
-
PARI
for(k=1,27,print1(ceil(sqrt(k!+1))^2-(k!+1),", ")) \\ Hugo Pfoertner, Dec 14 2019
Comments