login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A092488
a(n) = least k such that {n+0, n+1, n+2, n+3, ... n+k} has a nonempty subset the product of whose members is a square.
3
0, 2, 1, 0, 4, 3, 2, 1, 0, 6, 5, 4, 3, 2, 1, 0, 8, 7, 6, 5, 4, 3, 2, 1, 0, 9, 8, 8, 7, 6, 5, 4, 3, 2, 1, 0, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 13, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 13, 14, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 17
OFFSET
1,2
REFERENCES
R. K. Guy, Unsolved Problems in Number Theory, B30.
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
nonn,easy,look
AUTHOR
R. K. Guy, Apr 02 2004
STATUS
approved