A154782 Least integer y>=0 such that n+2y^2 is a square; -1 if n is not in A035251.
0, 0, 1, -1, 0, -1, -1, 1, 2, 0, -1, -1, -1, -1, 1, -1, 0, 2, 3, -1, -1, -1, -1, 1, -1, 0, -1, -1, 2, -1, -1, 3, 4, -1, 1, -1, 0, -1, -1, -1, -1, 2, -1, -1, -1, -1, 3, 1, -1, 0, 5, -1, -1, -1, -1, -1, 2, -1, -1, -1, -1, -1, 1, 3, 0, -1, -1, -1, 4, -1, -1, 5, 6, 2, -1, -1, -1, -1, -1, 1, -1, 0
Offset: 0
Keywords
Crossrefs
Cf. A035251.
Programs
-
PARI
A154782(n)={for(y=0,sqrtint(n\2),issquare(n+2*y^2)&return(y));-1}
Comments