login
A092487
a(n) = least k such that {n+1, n+2, n+3, ... n+k} has a subset the product of whose members with n is a square.
6
0, 4, 5, 0, 5, 6, 7, 7, 0, 8, 11, 8, 13, 7, 9, 0, 17, 9, 19, 10, 7, 11, 23, 8, 0, 13, 8, 12, 29, 12, 31, 13, 11, 17, 13, 0, 37, 19, 13, 10, 41, 14, 43, 11, 15, 23, 47, 6, 0, 13, 17, 13, 53, 16, 11, 16, 19, 29, 59, 15, 61, 31, 14, 0, 13, 14, 67, 17
OFFSET
1,2
COMMENTS
For n>1, n + a(n) is composite and n + a(n) is square if and only if n is square. - David A. Corneth, Oct 22 2016
REFERENCES
R. K. Guy, Unsolved Problems in Number Theory, B30.
LINKS
H. B. Bui, K. Pratt, and A. Zaharescu, A problem of Erdos-Graham-Granville-Selfridge on integral points on hyperelliptic curves, arXiv:2211.12467 [math.NT], 2022.
A. Granville and J. L. Selfridge, Products of integers in an interval, modulo squares, Electron. J. Combin. 8 (2001), no. 1.
FORMULA
a(n) = A006255(n) - n. - Peter Kagey, Oct 22 2016
a(n^2) = 0, a(p) = p for prime p > 3. - David A. Corneth, Oct 22 2016
EXAMPLE
a(48)=6 because 48*(48+2)*(48+6) is a square, but you can't square 48 with numbers from (48+1) to (48+5).
MATHEMATICA
Table[k = 0; Which[IntegerQ@ Sqrt@ n, k, And[PrimeQ@ n, n > 3], k = n, True, While[Length@ Select[n Map[Times @@ # &, n + Rest@ Subsets@ Range@ k], IntegerQ@ Sqrt@ # &] == 0, k++]]; k, {n, 40}] (* Michael De Vlieger, Oct 26 2016 *)
Table[k = 0; Which[IntegerQ@Sqrt@n, k, First@Last@FactorInteger@n > Sqrt[2 n] + 1, k = First@Last@FactorInteger@n, True, While[Length@Select[n Map[Times @@ # &, n + Rest@Subsets@Range@k], IntegerQ@Sqrt@# &] == 0, k++]]; k, {n, 100}] (* Joshua Stucky, December 5 2022 *)
PROG
(PARI) a(n) = {if(issquare(n), return(0)); if(isprime(n), if(n>3, return(n), return(n+2) )); my(l = List([n, n+1]), m=2); while(1, for(i=1, #l-2, forvec(v = vector(i, j, [2, #l-1]), if(issquare(l[1] * l[#l] * prod(k=1, #v, l[v[k]])), return(l[#l] - n)), 2)); listput(l, n+m); m++)} \\ David A. Corneth, Oct 22 2016
CROSSREFS
Sequence in context: A186930 A159567 A164357 * A322505 A192041 A132022
KEYWORD
nonn,easy
AUTHOR
Don Reble, Apr 03 2004
STATUS
approved