cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A082995 Distance from n!+1 to next larger square.

This page as a plain text file.
%I A082995 #17 Dec 14 2019 08:10:02
%S A082995 2,1,2,0,0,8,0,80,728,224,323,39168,82943,176399,215295,3444735,
%T A082995 26167683,114349224,255004928,1158920360,11638526760,42128246888,
%U A082995 191052974115,97216010328,2430400258224,1553580508515,4666092737475
%N A082995 Distance from n!+1 to next larger square.
%C A082995 The only known values of n such that n!+1 is a perfect square are 4, 5 and 7. Paul Leyland, et al. have found no other solutions for n <= 1 million (see link). For 1 <= n <= 11, n!+1 is within 1000 of being a square. Is there another n such that n!+1 <= "1000 away" from being a perfect square?
%H A082995 Amiram Eldar, <a href="/A082995/b082995.txt">Table of n, a(n) for n = 1..808</a>
%H A082995 P. Leyland, <a href="http://www.leyland.vispa.com/numth/misc_cnt/oddities.htm">Solutions to n!+1=m^2</a>.
%e A082995 a(5)=0 because 5!+1 is a square.
%e A082995 a(8)=80 because 8!+1 = 40321 and the next larger square is 40401, so 40401-40321 = 80.
%t A082995 a[n_] := Ceiling @ Sqrt[(f = n! + 1)]^2 - f; Array[a, 27] (* _Amiram Eldar_, Dec 14 2019 *)
%o A082995 (PARI) for(k=1,27,print1(ceil(sqrt(k!+1))^2-(k!+1),", ")) \\ _Hugo Pfoertner_, Dec 14 2019
%Y A082995 Cf. A038507, A087374.
%K A082995 nonn
%O A082995 1,1
%A A082995 _Jason Earls_, May 29 2003