login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

Smallest positive integer k, such that s-k*n is a square where s is the smallest square >= k*n.
1

%I #31 Nov 21 2014 17:57:31

%S 1,2,1,1,1,2,3,1,1,4,5,1,5,6,1,1,9,2,9,2,1,12,13,1,1,14,1,3,17,2,19,1,

%T 3,20,1,1,23,24,3,1,25,2,27,6,1,30,31,1,1,2,3,7,35,4,1,2,3,40,41,1,41,

%U 42,1,1,1,4,47,10,5,2,51,1,51,52,3,12,1,6,57,1,1,60,61,1,3,62,7,3,65,2

%N Smallest positive integer k, such that s-k*n is a square where s is the smallest square >= k*n.

%C 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.

%C Smallest positive integer k such that ceiling(sqrt(k*n))^2-k*n is a square.

%e 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.

%t 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}]

%o (PARI) a(n) = {k=1; while(!issquare(ceil(sqrt(k*n))^2-k*n), k++); k;} \\ _Michel Marcus_, Oct 24 2014

%Y Cf. A000290, A145236 (equals a(A000040)), A068527 (difference for k=1).

%Y Cf. A145016, A145022, A145023, A145047, A145048, A145049, A145050, A145215.

%K nonn

%O 1,2

%A _Valtteri Raiko_, Oct 24 2014