OFFSET
1,2
REFERENCES
R. K. Guy, Unsolved Problems in Number Theory, B30.
LINKS
Peter Kagey, Table of n, a(n) for n = 1..10000
EXAMPLE
Often a(n) is the distance from n to the next square. But, e.g., a(26)=9 (not 10) because 27*28*30*32*35 is a square.
MATHEMATICA
(* This program is not suitable to compute a large number of terms *)
a[n_] := Module[{n0, t}, n0 = Ceiling[Sqrt[n]]^2; If[n == n0, Return[0]]; Do[t = Table[n+j, {j, 0, k}]; If[AnyTrue[Subsets[t, {m}], IntegerQ[ Sqrt[ Times @@ #]]&], Return[k]], {k, 1, n0-n}, {m, 1, k+1}] ]; Table[an = a[n]; Print["a(", n, ") = ", an]; an, {n, 1, 200}] (* Jean-François Alcover, Nov 19 2016 *)
CROSSREFS
KEYWORD
AUTHOR
R. K. Guy, Apr 02 2004
STATUS
approved