A conjecture of N. Terai states that for any integer k>1, the equation x2+(2k−1)y=kz has only one solution, namely, (x,y,z)=(k−1,1,2). Using the structure of class groups of binary quadratic forms, we prove the conjecture when 4∥k, with 2k−1 a prime power and 4≤k≤1000.