Quote:
Originally Posted by Charles Kusniec

(y^2  (n^2  n))/(2*n  1) is an integer when
n^2  n == y^2 (mod 2*n1)
4*n^2  4*n == 4*y^2 (mod 2*n  1)
^{†}
(2*n  1)^2 == 4*y^2 +1 (mod 2*n  1)
4*y^2 + 1 == 0 (mod 2*n  1); that is,
2*n  1 divides 4*y^2 + 1
Since 4*y^2 + 1 is divisible only by primes congruent to 1 (mod 4), the same is true of its divisor 2*n  1. This solves (1) straightaway.
If n = 0, we have y^2 == 0 (mod 1) which is trivial.
If n < 0, we have that 2*n + 1 divides 4*y^2 + 1. This implies all divisors of 2*n + 1 are congruent to 1 (mod 4), so that n is even, solving (2) in the formulation of the second OEIS sequence.
^{†}Multiplying the congruence through by 4 is allowed, since 4 is relatively prime to 2*n  1.