These are the odd numbers 1 (mod 8), not a square, having in the composite case no prime factors 3 or 5 (mod 8), and the indefinite binary quadratic form x^2 - D*y^2 (with discriminant 4*D > 0) does not represent +8.

The odd numbers D which admit proper solutions to the Pell equation x^2 - D*y^2 = +8 with both x and y odd are given by A263012.