In this paper, we consider the Diophantine equation b + (a+ b) + · · ·+ (a (x− 1) + b) = = d + (c+ d) + · · ·+ (c (y − 1) + d) , where a, b, c, d, k, l are given integers with gcd(a, b) = gcd(c, d) = 1, k 6= l. We prove that, under some reasonable assumptions, the above equation has only finitely many solutions.