%I #14 Jul 14 2021 08:46:36
%S 1,2,4,5,6,8,9,13,15,17,25,32,39,49,52,54,56,63,64,80,87,89,90,95,98,
%T 100,104,111,128,135,144,148,152,153,159,176,183,189,200,207,224,225,
%U 230,231,233,248,255,272,279,285,288,296,303,305,319,320,327,329,344,351,368,369,370,374,375
%N Numbers k such that the distance between the k-th triangular number and the nearest square is a square.
%C A229118(a(n)) is a perfect square.
%e The nearest square to 6*7/2=21 is 25 and |21-25| = 2^2 so 6 is in the sequence.
%e The nearest square to 7*8/2=28 is 25 and |28-25| = 3 so 7 is not in the sequence.
%t tnsQ[n_]:=Module[{tno=(n(n+1))/2,sr,a,b},sr=Sqrt[tno];a=tno-Floor[sr]^2;b=Ceiling[sr]^2-tno;IntegerQ[Sqrt[Min[{a,b}]]]]; Select[Range[400],tnsQ] (* _Harvey P. Dale_, Mar 26 2015 *)
%Y Cf. A000217, A229118.
%K nonn
%O 1,2
%A _Ralf Stephan_, Sep 15 2013
|