|
|
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
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
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
|
|
|
FORMULA
|
|
|
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
|
|
|
KEYWORD
|
nonn,easy
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|