login
Numbers whose square can be written as the sum of two consecutive nonsquares.
2

%I #29 Nov 22 2023 21:15:01

%S 5,9,11,13,15,19,21,23,25,27,29,31,33,35,37,39,43,45,47,49,51,53,55,

%T 57,59,61,63,65,67,69,71,73,75,77,79,81,83,85,87,89,91,93,95,97,101,

%U 103,105,107,109,111,113,115,117,119,121,123,125,127,129,131

%N Numbers whose square can be written as the sum of two consecutive nonsquares.

%C Equivalently, odd numbers such that neither of the two integers next to n^2/2 is a square.

%C Complement of A257282 = square roots of A256944.

%C The odd numbers missing here are 1, 3, 7, 17, 41, 99, ... = A078057 (see also A001333 = abs(A123335)).

%H Michael De Vlieger, <a href="/A257292/b257292.txt">Table of n, a(n) for n = 1..10000</a>

%e 9 is a term because 9^2 = 81 = 40 + 41, neither of which are square.

%t Select[Range[1, 131, 2], AllTrue[{Floor[#^2/2], Ceiling[#^2/2]}, ! IntegerQ@ Sqrt@ # &] &] (* _Michael De Vlieger_, Dec 11 2015 *)

%o (PARI) select( is(n)={bittest(n,0) && !issquare(n^2\2) && !issquare(n^2\/2)}, [0..140]) \\ Corrected Jul 06 2021, thanks to an observation by _Bill McEachen_

%Y Cf. A001333, A078057, A123335, A256944, A257282.

%K nonn

%O 1,1

%A _M. F. Hasler_, May 08 2015