OFFSET
1,2
COMMENTS
For any n>=3, there exists at least one positive integer k, 1 <= k <= n-1 such that the difference between the smallest square >= k*n and k*n is a square. To prove this, consider the multiplier k = n-2. Then (n-2)*n = (n-1)^2-1, thus the difference from the next square is 1, which is a square. If n = 1, k = 1 and if n = 2, k = 2.
Smallest positive integer k such that ceiling(sqrt(k*n))^2-k*n is a square.
EXAMPLE
a(10) = 4, for ceiling(sqrt(10))^2-10 = 6, ceiling(sqrt(2*10))^2-2*10 = 5, ceiling(sqrt(3*10))^2-3*10 = 6 and ceiling(sqrt(4*10))^2-4*10 = 9 = 3^2.
MATHEMATICA
dif[n_] := Ceiling[Sqrt[n]]^2 - n; a[k_] := Module[{n = 1}, While[dif[dif[n*k]] != 0, n++]; Return[n]]; Table[a[k], {k, 1, 90}]
PROG
(PARI) a(n) = {k=1; while(!issquare(ceil(sqrt(k*n))^2-k*n), k++); k; } \\ Michel Marcus, Oct 24 2014
CROSSREFS
KEYWORD
nonn
AUTHOR
Valtteri Raiko, Oct 24 2014
STATUS
approved