Let \(k\ge 3\) and \(n\ge 3\) be odd integers, and let \(m\ge 0\) be any integer. For a prime number \(\ell \), we prove that the class number of the imaginary quadratic field \({\mathbb {Q}}(\sqrt{\ell ^{2m}-2k^n})\) is either divisible by n or by a specific divisor of n. Applying this result, we construct an infinite family of certain tuples of imaginary quadratic fields of the form: $$\begin{aligned} \left( {\mathbb {Q}}(\sqrt{d}), {\mathbb {Q}}(\sqrt{d+1}), {\mathbb {Q}}(\sqrt{4d+1}), {\mathbb {Q}}(\sqrt{2d+4}), {\mathbb {Q}}(\sqrt{2d+16}), \cdots , {\mathbb {Q}}(\sqrt{2d+4^t}) \right) \end{aligned}$$with \(d\in {\mathbb {Z}}\) and \(1\le 4^t\le 2|d|\) whose class numbers are all divisible by n. Our proofs use some deep results about primitive divisors of Lehmer sequences.